<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998


Desugaring list comprehensions, monad comprehensions and array comprehensions
-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE CPP, NamedFieldPuns #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.HsToCore.ListComp</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsListComp"><span class="hs-identifier">dsListComp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMonadComp"><span class="hs-identifier">dsMonadComp</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html"><span class="hs-identifier">GHC.HsToCore.Expr</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsHandleMonadicFailure"><span class="hs-identifier">dsHandleMonadicFailure</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier">dsExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier">dsLExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLExprNoLP"><span class="hs-identifier">dsLExprNoLP</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier">dsLocalBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier">dsSyntaxExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html"><span class="hs-identifier">GHC.HsToCore.Monad</span></a></span><span>          </span><span class="hs-comment">-- the monadery used in the desugarer</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Utils.html"><span class="hs-identifier">GHC.HsToCore.Utils</span></a></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html"><span class="hs-identifier">GHC.HsToCore.Match</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html"><span class="hs-identifier">GHC.Data.List.SetOps</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html#getNth"><span class="hs-identifier">getNth</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">{-
List comprehensions may be desugared in one of two ways: ``ordinary''
(as you would expect if you read SLPJ's book) and ``with foldr/build
turned on'' (if you read Gill {\em et al.}'s paper on the subject).

There will be at least one ``qualifier'' in the input.
-}</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsListComp"><span class="hs-identifier hs-type">dsListComp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprLStmt"><span class="hs-identifier hs-type">ExprLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-51"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>              </span><span class="hs-comment">-- Type of entire list</span><span>
</span><span id="line-52"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-53"></span><span id="dsListComp"><span class="annot"><span class="annottext">dsListComp :: [ExprLStmt GhcTc] -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsListComp"><span class="hs-identifier hs-var hs-var">dsListComp</span></a></span></span><span> </span><span id="local-6989586621681155306"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155306"><span class="hs-identifier hs-var">lquals</span></a></span></span><span> </span><span id="local-6989586621681155305"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155305"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-54"></span><span>    </span><span id="local-6989586621681155304"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681155304"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155302"><span class="annot"><span class="annottext">quals :: [ExprStmt GhcTc]
</span><a href="#local-6989586621681155302"><span class="hs-identifier hs-var hs-var">quals</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ExprLStmt GhcTc -&gt; ExprStmt GhcTc)
-&gt; [ExprLStmt GhcTc] -&gt; [ExprStmt GhcTc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ExprLStmt GhcTc -&gt; ExprStmt GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155306"><span class="hs-identifier hs-var">lquals</span></a></span><span>
</span><span id="line-56"></span><span>        </span><span id="local-6989586621681155300"><span class="annot"><span class="annottext">elt_ty :: Type
</span><a href="#local-6989586621681155300"><span class="hs-identifier hs-var hs-var">elt_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Type -&gt; [Type]
</span><a href="GHC.Tc.Utils.TcType.html#tcTyConAppArgs"><span class="hs-identifier hs-var">tcTyConAppArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155305"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-57"></span><span>                   </span><span class="hs-special">[</span><span id="local-6989586621681155298"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155298"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155298"><span class="hs-identifier hs-var">elt_ty</span></a></span><span>
</span><span id="line-58"></span><span>                   </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Type
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsListComp&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155305"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155306"><span class="hs-identifier hs-var">lquals</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_EnableRewriteRules"><span class="hs-identifier hs-var">Opt_EnableRewriteRules</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681155304"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_IgnoreInterfacePragmas"><span class="hs-identifier hs-var">Opt_IgnoreInterfacePragmas</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681155304"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-61"></span><span>       </span><span class="hs-comment">-- Either rules are switched off, or we are ignoring what there are;</span><span>
</span><span id="line-62"></span><span>       </span><span class="hs-comment">-- Either way foldr/build won't happen, so use the more efficient</span><span>
</span><span id="line-63"></span><span>       </span><span class="hs-comment">-- Wadler-style desugaring</span><span>
</span><span id="line-64"></span><span>       </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc] -&gt; Bool
forall {idL} {idR} {body}. [StmtLR idL idR body] -&gt; Bool
</span><a href="#local-6989586621681155289"><span class="hs-identifier hs-var">isParallelComp</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155302"><span class="hs-identifier hs-var">quals</span></a></span><span>
</span><span id="line-65"></span><span>       </span><span class="hs-comment">-- Foldr-style desugaring can't handle parallel list comprehensions</span><span>
</span><span id="line-66"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155302"><span class="hs-identifier hs-var">quals</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkNilExpr"><span class="hs-identifier hs-var">mkNilExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155300"><span class="hs-identifier hs-var">elt_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Type -&gt; ((Id, Type) -&gt; (Id, Type) -&gt; DsM CoreExpr) -&gt; DsM CoreExpr
forall (m :: * -&gt; *).
(MonadFail m, MonadThings m, MonadUnique m) =&gt;
Type -&gt; ((Id, Type) -&gt; (Id, Type) -&gt; m CoreExpr) -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkBuildExpr"><span class="hs-identifier hs-var">mkBuildExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155300"><span class="hs-identifier hs-var">elt_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681155285"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155285"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155284"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155284"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; [ExprStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155285"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155284"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155302"><span class="hs-identifier hs-var">quals</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>             </span><span class="hs-comment">-- Foldr/build should be enabled, so desugar</span><span>
</span><span id="line-69"></span><span>             </span><span class="hs-comment">-- into foldrs and builds</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-comment">-- We must test for ParStmt anywhere, not just at the head, because an extension</span><span>
</span><span id="line-73"></span><span>    </span><span class="hs-comment">-- to list comprehensions would be to add brackets to specify the associativity</span><span>
</span><span id="line-74"></span><span>    </span><span class="hs-comment">-- of qualifier lists. This is really easy to do by adding extra ParStmts into the</span><span>
</span><span id="line-75"></span><span>    </span><span class="hs-comment">-- mix of possibly a single element in length, so we do this to leave the possibility open</span><span>
</span><span id="line-76"></span><span>    </span><span id="local-6989586621681155289"><span class="annot"><span class="annottext">isParallelComp :: [StmtLR idL idR body] -&gt; Bool
</span><a href="#local-6989586621681155289"><span class="hs-identifier hs-var hs-var">isParallelComp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(StmtLR idL idR body -&gt; Bool) -&gt; [StmtLR idL idR body] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="annot"><span class="annottext">StmtLR idL idR body -&gt; Bool
forall {idL} {idR} {body}. StmtLR idL idR body -&gt; Bool
</span><a href="#local-6989586621681155280"><span class="hs-identifier hs-var">isParallelStmt</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>    </span><span id="local-6989586621681155280"><span class="annot"><span class="annottext">isParallelStmt :: StmtLR idL idR body -&gt; Bool
</span><a href="#local-6989586621681155280"><span class="hs-identifier hs-var hs-var">isParallelStmt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-type">ParStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-79"></span><span>    </span><span class="annot"><a href="#local-6989586621681155280"><span class="hs-identifier hs-var">isParallelStmt</span></a></span><span> </span><span class="annot"><span class="annottext">StmtLR idL idR body
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span class="hs-comment">-- This function lets you desugar a inner list comprehension and a list of the binders</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- of that comprehension that we need in the outer comprehension into such an expression</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- and the type of the elements that it outputs (tuples of binders)</span><span>
</span><span id="line-85"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsInnerListComp"><span class="hs-identifier hs-type">dsInnerListComp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span id="dsInnerListComp"><span class="annot"><span class="annottext">dsInnerListComp :: ParStmtBlock GhcTc GhcTc -&gt; DsM (CoreExpr, Type)
</span><a href="GHC.HsToCore.ListComp.html#dsInnerListComp"><span class="hs-identifier hs-var hs-var">dsInnerListComp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmtBlock GhcTc GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155276"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155276"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681155275"><span class="annot"><span class="annottext">[IdP GhcTc]
</span><a href="#local-6989586621681155275"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155274"><span class="annot"><span class="annottext">bndrs_tuple_type :: Type
</span><a href="#local-6989586621681155274"><span class="hs-identifier hs-var hs-var">bndrs_tuple_type</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681155275"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-88"></span><span>             </span><span id="local-6989586621681155272"><span class="annot"><span class="annottext">list_ty :: Type
</span><a href="#local-6989586621681155272"><span class="hs-identifier hs-var hs-var">list_ty</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkListTy"><span class="hs-identifier hs-var">mkListTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155274"><span class="hs-identifier hs-var">bndrs_tuple_type</span></a></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span>             </span><span class="hs-comment">-- really use original bndrs below!</span><span>
</span><span id="line-91"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155270"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155270"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsListComp"><span class="hs-identifier hs-var">dsListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155276"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; [ExprLStmt GhcTc] -&gt; [ExprLStmt GhcTc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ExprStmt GhcTc -&gt; ExprLStmt GhcTc
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(ExprStmt GhcTc -&gt; ExprLStmt GhcTc)
-&gt; ExprStmt GhcTc -&gt; ExprLStmt GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; ExprStmt GhcTc
forall (idR :: Pass) (bodyR :: * -&gt; *) (idL :: Pass).
IsPass idR =&gt;
Located (bodyR (GhcPass idR))
-&gt; StmtLR
     (GhcPass idL) (GhcPass idR) (Located (bodyR (GhcPass idR)))
</span><a href="GHC.Hs.Utils.html#mkLastStmt"><span class="hs-identifier hs-var">mkLastStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; LHsExpr GhcTc
</span><a href="GHC.HsToCore.Utils.html#mkBigLHsVarTupId"><span class="hs-identifier hs-var">mkBigLHsVarTupId</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681155275"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155272"><span class="hs-identifier hs-var">list_ty</span></a></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CoreExpr, Type) -&gt; DsM (CoreExpr, Type)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155270"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155274"><span class="hs-identifier hs-var">bndrs_tuple_type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">-- This function factors out commonality between the desugaring strategies for GroupStmt.</span><span>
</span><span id="line-96"></span><span class="hs-comment">-- Given such a statement it gives you back an expression representing how to compute the transformed</span><span>
</span><span id="line-97"></span><span class="hs-comment">-- list and the tuple that you need to bind from that list in order to proceed with your desugaring</span><span>
</span><span id="line-98"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsTransStmt"><span class="hs-identifier hs-type">dsTransStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ExprStmt"><span class="hs-identifier hs-type">ExprStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span id="dsTransStmt"><span class="annot"><span class="annottext">dsTransStmt :: ExprStmt GhcTc -&gt; DsM (CoreExpr, LPat GhcTc)
</span><a href="GHC.HsToCore.ListComp.html#dsTransStmt"><span class="hs-identifier hs-var hs-var">dsTransStmt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">trS_form :: forall idL idR body. StmtLR idL idR body -&gt; TransForm
</span><a href="GHC.Hs.Expr.html#trS_form"><span class="hs-identifier hs-var">trS_form</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155263"><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681155263"><span class="hs-identifier hs-var">form</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_stmts :: forall idL idR body. StmtLR idL idR body -&gt; [ExprLStmt idL]
</span><a href="GHC.Hs.Expr.html#trS_stmts"><span class="hs-identifier hs-var">trS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155261"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155261"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bndrs :: forall idL idR body. StmtLR idL idR body -&gt; [(IdP idR, IdP idR)]
</span><a href="GHC.Hs.Expr.html#trS_bndrs"><span class="hs-identifier hs-var">trS_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155259"><span class="annot"><span class="annottext">[(IdP GhcTc, IdP GhcTc)]
</span><a href="#local-6989586621681155259"><span class="hs-identifier hs-var">binderMap</span></a></span></span><span>
</span><span id="line-100"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_by :: forall idL idR body. StmtLR idL idR body -&gt; Maybe (LHsExpr idR)
</span><a href="GHC.Hs.Expr.html#trS_by"><span class="hs-identifier hs-var">trS_by</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155257"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681155257"><span class="hs-identifier hs-var">by</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_using :: forall idL idR body. StmtLR idL idR body -&gt; LHsExpr idR
</span><a href="GHC.Hs.Expr.html#trS_using"><span class="hs-identifier hs-var">trS_using</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155255"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155255"><span class="hs-identifier hs-var">using</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-101"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155254"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155254"><span class="hs-identifier hs-var">from_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155253"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155253"><span class="hs-identifier hs-var">to_bndrs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Id)] -&gt; ([Id], [Id])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Id)]
[(IdP GhcTc, IdP GhcTc)]
</span><a href="#local-6989586621681155259"><span class="hs-identifier hs-var">binderMap</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155251"><span class="annot"><span class="annottext">from_bndrs_tys :: [Type]
</span><a href="#local-6989586621681155251"><span class="hs-identifier hs-var hs-var">from_bndrs_tys</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Type) -&gt; [Id] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155254"><span class="hs-identifier hs-var">from_bndrs</span></a></span><span>
</span><span id="line-104"></span><span>        </span><span id="local-6989586621681155249"><span class="annot"><span class="annottext">to_bndrs_tys :: [Type]
</span><a href="#local-6989586621681155249"><span class="hs-identifier hs-var hs-var">to_bndrs_tys</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Type) -&gt; [Id] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155253"><span class="hs-identifier hs-var">to_bndrs</span></a></span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span>        </span><span id="local-6989586621681155248"><span class="annot"><span class="annottext">to_bndrs_tup_ty :: Type
</span><a href="#local-6989586621681155248"><span class="hs-identifier hs-var hs-var">to_bndrs_tup_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var">mkBigCoreTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155249"><span class="hs-identifier hs-var">to_bndrs_tys</span></a></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span>    </span><span class="hs-comment">-- Desugar an inner comprehension which outputs a list of tuples of the &quot;from&quot; binders</span><span>
</span><span id="line-109"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155246"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155246"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155245"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155245"><span class="hs-identifier hs-var">from_tup_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParStmtBlock GhcTc GhcTc -&gt; DsM (CoreExpr, Type)
</span><a href="GHC.HsToCore.ListComp.html#dsInnerListComp"><span class="hs-identifier hs-var">dsInnerListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XParStmtBlock GhcTc GhcTc
-&gt; [ExprLStmt GhcTc]
-&gt; [IdP GhcTc]
-&gt; SyntaxExpr GhcTc
-&gt; ParStmtBlock GhcTc GhcTc
forall idL idR.
XParStmtBlock idL idR
-&gt; [ExprLStmt idL]
-&gt; [IdP idR]
-&gt; SyntaxExpr idR
-&gt; ParStmtBlock idL idR
</span><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-var">ParStmtBlock</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XParStmtBlock GhcTc GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155261"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-110"></span><span>                                                        </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681155254"><span class="hs-identifier hs-var">from_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span>    </span><span class="hs-comment">-- Work out what arguments should be supplied to that expression: i.e. is an extraction</span><span>
</span><span id="line-113"></span><span>    </span><span class="hs-comment">-- function required? If so, create that desugared function and add to arguments</span><span>
</span><span id="line-114"></span><span>    </span><span id="local-6989586621681155242"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155242"><span class="hs-identifier hs-var">usingExpr'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155255"><span class="hs-identifier hs-var">using</span></a></span><span>
</span><span id="line-115"></span><span>    </span><span id="local-6989586621681155241"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155241"><span class="hs-identifier hs-var">usingArgs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681155257"><span class="hs-identifier hs-var">by</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-116"></span><span>                    </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155246"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-117"></span><span>                    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681155240"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155240"><span class="hs-identifier hs-var">by_e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155239"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155239"><span class="hs-identifier hs-var">by_e'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155240"><span class="hs-identifier hs-var">by_e</span></a></span><span>
</span><span id="line-118"></span><span>                                    </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155238"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155238"><span class="hs-identifier hs-var">lam'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#matchTuple"><span class="hs-identifier hs-var">matchTuple</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155254"><span class="hs-identifier hs-var">from_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155239"><span class="hs-identifier hs-var">by_e'</span></a></span><span>
</span><span id="line-119"></span><span>                                    </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155238"><span class="hs-identifier hs-var">lam'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155246"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-120"></span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-comment">-- Create an unzip function for the appropriate arity and element types and find &quot;map&quot;</span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621681155236"><span class="annot"><span class="annottext">Maybe (Id, CoreExpr)
</span><a href="#local-6989586621681155236"><span class="hs-identifier hs-var">unzip_stuff'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TransForm -&gt; [Type] -&gt; DsM (Maybe (Id, CoreExpr))
</span><a href="GHC.HsToCore.ListComp.html#mkUnzipBind"><span class="hs-identifier hs-var">mkUnzipBind</span></a></span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681155263"><span class="hs-identifier hs-var">form</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155251"><span class="hs-identifier hs-var">from_bndrs_tys</span></a></span><span>
</span><span id="line-123"></span><span>    </span><span id="local-6989586621681155234"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155234"><span class="hs-identifier hs-var">map_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#mapName"><span class="hs-identifier hs-var">mapName</span></a></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-comment">-- Generate the expressions to build the grouped list</span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- First we apply the grouping function to the inner list</span><span>
</span><span id="line-127"></span><span>        </span><span id="local-6989586621681155231"><span class="annot"><span class="annottext">inner_list_expr' :: CoreExpr
</span><a href="#local-6989586621681155231"><span class="hs-identifier hs-var hs-var">inner_list_expr'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155242"><span class="hs-identifier hs-var">usingExpr'</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155241"><span class="hs-identifier hs-var">usingArgs'</span></a></span><span>
</span><span id="line-128"></span><span>        </span><span class="hs-comment">-- Then we map our &quot;unzip&quot; across it to turn the lists of tuples into tuples of lists</span><span>
</span><span id="line-129"></span><span>        </span><span class="hs-comment">-- We make sure we instantiate the type variable &quot;a&quot; to be a list of &quot;from&quot; tuples and</span><span>
</span><span id="line-130"></span><span>        </span><span class="hs-comment">-- the &quot;b&quot; to be a tuple of &quot;to&quot; lists!</span><span>
</span><span id="line-131"></span><span>        </span><span class="hs-comment">-- Then finally we bind the unzip function around that expression</span><span>
</span><span id="line-132"></span><span>        </span><span id="local-6989586621681155229"><span class="annot"><span class="annottext">bound_unzipped_inner_list_expr' :: CoreExpr
</span><a href="#local-6989586621681155229"><span class="hs-identifier hs-var hs-var">bound_unzipped_inner_list_expr'</span></a></span></span><span>
</span><span id="line-133"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, CoreExpr)
</span><a href="#local-6989586621681155236"><span class="hs-identifier hs-var">unzip_stuff'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-134"></span><span>              </span><span class="annot"><span class="annottext">Maybe (Id, CoreExpr)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155231"><span class="hs-identifier hs-var">inner_list_expr'</span></a></span><span>
</span><span id="line-135"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155228"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155228"><span class="hs-identifier hs-var">unzip_fn'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155227"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155227"><span class="hs-identifier hs-var">unzip_rhs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-136"></span><span>                </span><span class="annot"><span class="annottext">Bind Id -&gt; CoreExpr -&gt; CoreExpr
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, CoreExpr)] -&gt; Bind Id
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155228"><span class="hs-identifier hs-var">unzip_fn'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155227"><span class="hs-identifier hs-var">unzip_rhs'</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-137"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155234"><span class="hs-identifier hs-var">map_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([CoreExpr] -&gt; CoreExpr) -&gt; [CoreExpr] -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-138"></span><span>                </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkListTy"><span class="hs-identifier hs-var">mkListTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155245"><span class="hs-identifier hs-var">from_tup_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155248"><span class="hs-identifier hs-var">to_bndrs_tup_ty</span></a></span><span>
</span><span id="line-140"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155228"><span class="hs-identifier hs-var">unzip_fn'</span></a></span><span>
</span><span id="line-141"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155231"><span class="hs-identifier hs-var">inner_list_expr'</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span>    </span><span class="annot"><span class="annottext">Type -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#dsNoLevPoly"><span class="hs-identifier hs-var">dsNoLevPoly</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Type -&gt; Type
HasDebugCallStack =&gt; Int -&gt; Type -&gt; Type
</span><a href="GHC.Tc.Utils.TcType.html#tcFunResultTyN"><span class="hs-identifier hs-var">tcFunResultTyN</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreExpr] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155241"><span class="hs-identifier hs-var">usingArgs'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155242"><span class="hs-identifier hs-var">usingExpr'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the result of a&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;using&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;function:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155255"><span class="hs-identifier hs-var">using</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span>    </span><span class="hs-comment">-- Build a pattern that ensures the consumer binds into the NEW binders,</span><span>
</span><span id="line-147"></span><span>    </span><span class="hs-comment">-- which hold lists rather than single values</span><span>
</span><span id="line-148"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155215"><span class="annot"><span class="annottext">pat :: LPat GhcTc
</span><a href="#local-6989586621681155215"><span class="hs-identifier hs-var hs-var">pat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; LPat GhcTc
</span><a href="GHC.HsToCore.Utils.html#mkBigLHsVarPatTupId"><span class="hs-identifier hs-var">mkBigLHsVarPatTupId</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155253"><span class="hs-identifier hs-var">to_bndrs</span></a></span><span>  </span><span class="hs-comment">-- NB: no '!</span><span>
</span><span id="line-149"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, Located (Pat GhcTc))
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (CoreExpr, Located (Pat GhcTc))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155229"><span class="hs-identifier hs-var">bound_unzipped_inner_list_expr'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681155215"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsTransStmt"><span class="hs-identifier hs-var">dsTransStmt</span></a></span><span> </span><span class="annot"><span class="annottext">ExprStmt GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (CoreExpr, Located (Pat GhcTc))
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsTransStmt: Not given a TransStmt&quot;</span></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
*           Ordinary desugaring of list comprehensions                 *
*                                                                      *
************************************************************************

Just as in Phil's chapter~7 in SLPJ, using the rules for
optimally-compiled list comprehensions.  This is what Kevin followed
as well, and I quite happily do the same.  The TQ translation scheme
transforms a list of qualifiers (either boolean expressions or
generators) into a single expression which implements the list
comprehension.  Because we are generating 2nd-order polymorphic
lambda-calculus, calls to NIL and CONS must be applied to a type
argument, as well as their usual value arguments.
\begin{verbatim}
TE &lt;&lt; [ e | qs ] &gt;&gt;  =  TQ &lt;&lt; [ e | qs ] ++ Nil (typeOf e) &gt;&gt;

(Rule C)
TQ &lt;&lt; [ e | ] ++ L &gt;&gt; = Cons (typeOf e) TE &lt;&lt;e&gt;&gt; TE &lt;&lt;L&gt;&gt;

(Rule B)
TQ &lt;&lt; [ e | b , qs ] ++ L &gt;&gt; =
    if TE &lt;&lt; b &gt;&gt; then TQ &lt;&lt; [ e | qs ] ++ L &gt;&gt; else TE &lt;&lt; L &gt;&gt;

(Rule A')
TQ &lt;&lt; [ e | p &lt;- L1, qs ]  ++  L2 &gt;&gt; =
  letrec
    h = \ u1 -&gt;
          case u1 of
            []        -&gt;  TE &lt;&lt; L2 &gt;&gt;
            (u2 : u3) -&gt;
                  (( \ TE &lt;&lt; p &gt;&gt; -&gt; ( TQ &lt;&lt; [e | qs]  ++  (h u3) &gt;&gt; )) u2)
                    [] (h u3)
  in
    h ( TE &lt;&lt; L1 &gt;&gt; )

&quot;h&quot;, &quot;u1&quot;, &quot;u2&quot;, and &quot;u3&quot; are new variables.
\end{verbatim}

@deListComp@ is the TQ translation scheme.  Roughly speaking, @dsExpr@
is the TE translation scheme.  Note that we carry around the @L@ list
already desugared.  @dsListComp@ does the top TE rule mentioned above.

To the above, we add an additional rule to deal with parallel list
comprehensions.  The translation goes roughly as follows:
     [ e | p1 &lt;- e11, let v1 = e12, p2 &lt;- e13
         | q1 &lt;- e21, let v2 = e22, q2 &lt;- e23]
     =&gt;
     [ e | ((x1, .., xn), (y1, ..., ym)) &lt;-
               zip [(x1,..,xn) | p1 &lt;- e11, let v1 = e12, p2 &lt;- e13]
                   [(y1,..,ym) | q1 &lt;- e21, let v2 = e22, q2 &lt;- e23]]
where (x1, .., xn) are the variables bound in p1, v1, p2
      (y1, .., ym) are the variables bound in q1, v2, q2

In the translation below, the ParStmt branch translates each parallel branch
into a sub-comprehension, and desugars each independently.  The resulting lists
are fed to a zip function, we create a binding for all the variables bound in all
the comprehensions, and then we hand things off the desugarer for bindings.
The zip function is generated here a) because it's small, and b) because then we
don't have to deal with arbitrary limits on the number of zip functions in the
prelude, nor which library the zip function came from.
The introduced tuples are Boxed, but only because I couldn't get it to work
with the Unboxed variety.
-}</span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-type">deListComp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprStmt"><span class="hs-identifier hs-type">ExprStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span id="deListComp"><span class="annot"><span class="annottext">deListComp :: [ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var hs-var">deListComp</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;deListComp&quot;</span></span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155211"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155211"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155210"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155210"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155209"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155209"><span class="hs-identifier hs-var">list</span></a></span></span><span>
</span><span id="line-224"></span><span>  </span><span class="hs-glyph">=</span><span>     </span><span class="hs-comment">-- Figure 7.4, SLPJ, p 135, rule C above</span><span>
</span><span id="line-225"></span><span>    </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">quals</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155204"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155204"><span class="hs-identifier hs-var">core_body</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155211"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-227"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkConsExpr"><span class="hs-identifier hs-var">mkConsExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155204"><span class="hs-identifier hs-var">core_body</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155204"><span class="hs-identifier hs-var">core_body</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155209"><span class="hs-identifier hs-var">list</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span>        </span><span class="hs-comment">-- Non-last: must be a guard</span><span>
</span><span id="line-230"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155201"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155201"><span class="hs-identifier hs-var">guard</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155200"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155200"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155199"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155199"><span class="hs-identifier hs-var">list</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-comment">-- rule B above</span><span>
</span><span id="line-231"></span><span>    </span><span id="local-6989586621681155198"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155198"><span class="hs-identifier hs-var">core_guard</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155201"><span class="hs-identifier hs-var">guard</span></a></span><span>
</span><span id="line-232"></span><span>    </span><span id="local-6989586621681155197"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155197"><span class="hs-identifier hs-var">core_rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155200"><span class="hs-identifier hs-var">quals</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155199"><span class="hs-identifier hs-var">list</span></a></span><span>
</span><span id="line-233"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIfThenElse"><span class="hs-identifier hs-var">mkIfThenElse</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155198"><span class="hs-identifier hs-var">core_guard</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155197"><span class="hs-identifier hs-var">core_rest</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155199"><span class="hs-identifier hs-var">list</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="hs-comment">-- [e | let B, qs] = let B in [e | qs]</span><span>
</span><span id="line-236"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LetStmt"><span class="hs-identifier hs-type">LetStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLetStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155194"><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc
</span><a href="#local-6989586621681155194"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155193"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155193"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155192"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155192"><span class="hs-identifier hs-var">list</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-237"></span><span>    </span><span id="local-6989586621681155191"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155191"><span class="hs-identifier hs-var">core_rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155193"><span class="hs-identifier hs-var">quals</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155192"><span class="hs-identifier hs-var">list</span></a></span><span>
</span><span id="line-238"></span><span>    </span><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier hs-var">dsLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc
</span><a href="#local-6989586621681155194"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155191"><span class="hs-identifier hs-var">core_rest</span></a></span><span>
</span><span id="line-239"></span><span>
</span><span id="line-240"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155190"><span class="annot"><span class="annottext">stmt :: ExprStmt GhcTc
</span><a href="#local-6989586621681155190"><span class="hs-identifier hs-var">stmt</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155189"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155189"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155188"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155188"><span class="hs-identifier hs-var">list</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-241"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155187"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155187"><span class="hs-identifier hs-var">inner_list_expr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155186"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681155186"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExprStmt GhcTc -&gt; DsM (CoreExpr, LPat GhcTc)
</span><a href="GHC.HsToCore.ListComp.html#dsTransStmt"><span class="hs-identifier hs-var">dsTransStmt</span></a></span><span> </span><span class="annot"><span class="annottext">ExprStmt GhcTc
</span><a href="#local-6989586621681155190"><span class="hs-identifier hs-var">stmt</span></a></span><span>
</span><span id="line-242"></span><span>    </span><span class="annot"><span class="annottext">LPat GhcTc
-&gt; CoreExpr -&gt; [ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deBindComp"><span class="hs-identifier hs-var">deBindComp</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681155186"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155187"><span class="hs-identifier hs-var">inner_list_expr</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155189"><span class="hs-identifier hs-var">quals</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155188"><span class="hs-identifier hs-var">list</span></a></span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155183"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155183"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681155182"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155182"><span class="hs-identifier hs-var">list1</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155181"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155181"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155180"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155180"><span class="hs-identifier hs-var">core_list2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-comment">-- rule A' above</span><span>
</span><span id="line-245"></span><span>    </span><span id="local-6989586621681155179"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155179"><span class="hs-identifier hs-var">core_list1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExprNoLP"><span class="hs-identifier hs-var">dsLExprNoLP</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155182"><span class="hs-identifier hs-var">list1</span></a></span><span>
</span><span id="line-246"></span><span>    </span><span class="annot"><span class="annottext">LPat GhcTc
-&gt; CoreExpr -&gt; [ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deBindComp"><span class="hs-identifier hs-var">deBindComp</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155183"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155179"><span class="hs-identifier hs-var">core_list1</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155181"><span class="hs-identifier hs-var">quals</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155180"><span class="hs-identifier hs-var">core_list2</span></a></span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-type">ParStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155178"><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681155178"><span class="hs-identifier hs-var">stmtss_w_bndrs</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155177"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155177"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155176"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155176"><span class="hs-identifier hs-var">list</span></a></span></span><span>
</span><span id="line-249"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155175"><span class="annot"><span class="annottext">[(CoreExpr, Type)]
</span><a href="#local-6989586621681155175"><span class="hs-identifier hs-var">exps_and_qual_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(ParStmtBlock GhcTc GhcTc -&gt; DsM (CoreExpr, Type))
-&gt; [ParStmtBlock GhcTc GhcTc]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [(CoreExpr, Type)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">ParStmtBlock GhcTc GhcTc -&gt; DsM (CoreExpr, Type)
</span><a href="GHC.HsToCore.ListComp.html#dsInnerListComp"><span class="hs-identifier hs-var">dsInnerListComp</span></a></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681155178"><span class="hs-identifier hs-var">stmtss_w_bndrs</span></a></span><span>
</span><span id="line-250"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155173"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155173"><span class="hs-identifier hs-var">exps</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155172"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155172"><span class="hs-identifier hs-var">qual_tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(CoreExpr, Type)] -&gt; ([CoreExpr], [Type])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(CoreExpr, Type)]
</span><a href="#local-6989586621681155175"><span class="hs-identifier hs-var">exps_and_qual_tys</span></a></span><span>
</span><span id="line-251"></span><span>
</span><span id="line-252"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155171"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155171"><span class="hs-identifier hs-var">zip_fn</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155170"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155170"><span class="hs-identifier hs-var">zip_rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; DsM (Id, CoreExpr)
</span><a href="GHC.HsToCore.ListComp.html#mkZipBind"><span class="hs-identifier hs-var">mkZipBind</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155172"><span class="hs-identifier hs-var">qual_tys</span></a></span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span>        </span><span class="hs-comment">-- Deal with [e | pat &lt;- zip l1 .. ln] in example above</span><span>
</span><span id="line-255"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
-&gt; CoreExpr -&gt; [ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deBindComp"><span class="hs-identifier hs-var">deBindComp</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155168"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bind Id -&gt; CoreExpr -&gt; CoreExpr
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, CoreExpr)] -&gt; Bind Id
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155171"><span class="hs-identifier hs-var">zip_fn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155170"><span class="hs-identifier hs-var">zip_rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155171"><span class="hs-identifier hs-var">zip_fn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155173"><span class="hs-identifier hs-var">exps</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-256"></span><span>                    </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155177"><span class="hs-identifier hs-var">quals</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155176"><span class="hs-identifier hs-var">list</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-257"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-258"></span><span>        </span><span id="local-6989586621681155167"><span class="annot"><span class="annottext">bndrs_s :: [[Id]]
</span><a href="#local-6989586621681155167"><span class="hs-identifier hs-var hs-var">bndrs_s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681155166"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmtBlock GhcTc GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155166"><span class="annot"><span class="annottext">[IdP GhcTc]
</span><a href="#local-6989586621681155166"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681155178"><span class="hs-identifier hs-var">stmtss_w_bndrs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span>        </span><span class="hs-comment">-- pat is the pattern ((x1,..,xn), (y1,..,ym)) in the example above</span><span>
</span><span id="line-261"></span><span>        </span><span id="local-6989586621681155168"><span class="annot"><span class="annottext">pat :: LPat GhcTc
</span><a href="#local-6989586621681155168"><span class="hs-identifier hs-var hs-var">pat</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LPat GhcTc] -&gt; LPat GhcTc
</span><a href="GHC.HsToCore.Utils.html#mkBigLHsPatTupId"><span class="hs-identifier hs-var">mkBigLHsPatTupId</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681155164"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-262"></span><span>        </span><span id="local-6989586621681155164"><span class="annot"><span class="annottext">pats :: [Located (Pat GhcTc)]
</span><a href="#local-6989586621681155164"><span class="hs-identifier hs-var hs-var">pats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Id] -&gt; Located (Pat GhcTc)) -&gt; [[Id]] -&gt; [Located (Pat GhcTc)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Located (Pat GhcTc)
[Id] -&gt; LPat GhcTc
</span><a href="GHC.HsToCore.Utils.html#mkBigLHsVarPatTupId"><span class="hs-identifier hs-var">mkBigLHsVarPatTupId</span></a></span><span> </span><span class="annot"><span class="annottext">[[Id]]
</span><a href="#local-6989586621681155167"><span class="hs-identifier hs-var">bndrs_s</span></a></span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#RecStmt"><span class="hs-identifier hs-type">RecStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;deListComp RecStmt&quot;</span></span><span>
</span><span id="line-265"></span><span>
</span><span id="line-266"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeStmt"><span class="hs-identifier hs-type">ApplicativeStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-267"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;deListComp ApplicativeStmt&quot;</span></span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#deBindComp"><span class="hs-identifier hs-type">deBindComp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-270"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-271"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprStmt"><span class="hs-identifier hs-type">ExprStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-272"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-273"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Expr"><span class="hs-identifier hs-type">Expr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-274"></span><span id="deBindComp"><span class="annot"><span class="annottext">deBindComp :: LPat GhcTc
-&gt; CoreExpr -&gt; [ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deBindComp"><span class="hs-identifier hs-var hs-var">deBindComp</span></a></span></span><span> </span><span id="local-6989586621681155161"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155161"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681155160"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155160"><span class="hs-identifier hs-var">core_list1</span></a></span></span><span> </span><span id="local-6989586621681155159"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155159"><span class="hs-identifier hs-var">quals</span></a></span></span><span> </span><span id="local-6989586621681155158"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155158"><span class="hs-identifier hs-var">core_list2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-275"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155157"><span class="annot"><span class="annottext">u3_ty :: Type
</span><a href="#local-6989586621681155157"><span class="hs-identifier hs-var">u3_ty</span></a></span></span><span class="hs-glyph">@</span><span id="local-6989586621681155156"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155156"><span class="hs-identifier hs-var">u1_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155160"><span class="hs-identifier hs-var">core_list1</span></a></span><span>       </span><span class="hs-comment">-- two names, same thing</span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span>        </span><span class="hs-comment">-- u1_ty is a [alpha] type, and u2_ty = alpha</span><span>
</span><span id="line-278"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155155"><span class="annot"><span class="annottext">u2_ty :: Type
</span><a href="#local-6989586621681155155"><span class="hs-identifier hs-var hs-var">u2_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; Type
</span><a href="GHC.Tc.Utils.Zonk.html#hsLPatType"><span class="hs-identifier hs-var">hsLPatType</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155161"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155153"><span class="annot"><span class="annottext">res_ty :: Type
</span><a href="#local-6989586621681155153"><span class="hs-identifier hs-var hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155158"><span class="hs-identifier hs-var">core_list2</span></a></span><span>
</span><span id="line-281"></span><span>        </span><span id="local-6989586621681155152"><span class="annot"><span class="annottext">h_ty :: Type
</span><a href="#local-6989586621681155152"><span class="hs-identifier hs-var hs-var">h_ty</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155156"><span class="hs-identifier hs-var">u1_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155153"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-282"></span><span>
</span><span id="line-283"></span><span>       </span><span class="hs-comment">-- no levity polymorphism here, as list comprehensions don't work</span><span>
</span><span id="line-284"></span><span>       </span><span class="hs-comment">-- with RebindableSyntax. NB: These are *not* monad comps.</span><span>
</span><span id="line-285"></span><span>    </span><span class="hs-special">[</span><span id="local-6989586621681155150"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155150"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155149"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155149"><span class="hs-identifier hs-var">u1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155148"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155148"><span class="hs-identifier hs-var">u2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155147"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155147"><span class="hs-identifier hs-var">u3</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Scaled Type] -&gt; DsM [Id]
</span><a href="GHC.HsToCore.Monad.html#newSysLocalsDs"><span class="hs-identifier hs-var">newSysLocalsDs</span></a></span><span> </span><span class="annot"><span class="annottext">([Scaled Type] -&gt; DsM [Id]) -&gt; [Scaled Type] -&gt; DsM [Id]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Scaled Type) -&gt; [Type] -&gt; [Scaled Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Scaled Type
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155152"><span class="hs-identifier hs-var">h_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155156"><span class="hs-identifier hs-var">u1_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155155"><span class="hs-identifier hs-var">u2_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155157"><span class="hs-identifier hs-var">u3_ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span>    </span><span class="hs-comment">-- the &quot;fail&quot; value ...</span><span>
</span><span id="line-288"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-289"></span><span>        </span><span id="local-6989586621681155144"><span class="annot"><span class="annottext">core_fail :: CoreExpr
</span><a href="#local-6989586621681155144"><span class="hs-identifier hs-var hs-var">core_fail</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155150"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155147"><span class="hs-identifier hs-var">u3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>        </span><span id="local-6989586621681155142"><span class="annot"><span class="annottext">letrec_body :: CoreExpr
</span><a href="#local-6989586621681155142"><span class="hs-identifier hs-var hs-var">letrec_body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155150"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155160"><span class="hs-identifier hs-var">core_list1</span></a></span><span>
</span><span id="line-291"></span><span>
</span><span id="line-292"></span><span>    </span><span id="local-6989586621681155141"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155141"><span class="hs-identifier hs-var">rest_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#deListComp"><span class="hs-identifier hs-var">deListComp</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155159"><span class="hs-identifier hs-var">quals</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155144"><span class="hs-identifier hs-var">core_fail</span></a></span><span>
</span><span id="line-293"></span><span>    </span><span id="local-6989586621681155140"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155140"><span class="hs-identifier hs-var">core_match</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.html#matchSimply"><span class="hs-identifier hs-var">matchSimply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155148"><span class="hs-identifier hs-var">u2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
forall p. HsStmtContext p
</span><a href="GHC.Hs.Expr.html#ListComp"><span class="hs-identifier hs-var">ListComp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155161"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155141"><span class="hs-identifier hs-var">rest_expr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155144"><span class="hs-identifier hs-var">core_fail</span></a></span><span>
</span><span id="line-294"></span><span>
</span><span id="line-295"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-296"></span><span>        </span><span id="local-6989586621681155136"><span class="annot"><span class="annottext">rhs :: CoreExpr
</span><a href="#local-6989586621681155136"><span class="hs-identifier hs-var hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155149"><span class="hs-identifier hs-var">u1</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-297"></span><span>              </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; Type -&gt; [Alt Id] -&gt; CoreExpr
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155149"><span class="hs-identifier hs-var">u1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155149"><span class="hs-identifier hs-var">u1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155153"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-298"></span><span>                   </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#nilDataCon"><span class="hs-identifier hs-var">nilDataCon</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>       </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155158"><span class="hs-identifier hs-var">core_list2</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-299"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#consDataCon"><span class="hs-identifier hs-var">consDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155148"><span class="hs-identifier hs-var">u2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155147"><span class="hs-identifier hs-var">u3</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155140"><span class="hs-identifier hs-var">core_match</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-300"></span><span>                        </span><span class="hs-comment">-- Increasing order of tag</span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bind Id -&gt; CoreExpr -&gt; CoreExpr
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, CoreExpr)] -&gt; Bind Id
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155150"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155136"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155142"><span class="hs-identifier hs-var">letrec_body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
*           Foldr/Build desugaring of list comprehensions              *
*                                                                      *
************************************************************************

@dfListComp@ are the rules used with foldr/build turned on:

\begin{verbatim}
TE[ e | ]            c n = c e n
TE[ e | b , q ]      c n = if b then TE[ e | q ] c n else n
TE[ e | p &lt;- l , q ] c n = let
                                f = \ x b -&gt; case x of
                                                  p -&gt; TE[ e | q ] c b
                                                  _ -&gt; b
                           in
                           foldr f n l
\end{verbatim}
-}</span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-type">dfListComp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>            </span><span class="hs-comment">-- 'c' and 'n'</span><span>
</span><span id="line-326"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprStmt"><span class="hs-identifier hs-type">ExprStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- the rest of the qual's</span><span>
</span><span id="line-327"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span id="dfListComp"><span class="annot"><span class="annottext">dfListComp :: Id -&gt; Id -&gt; [ExprStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var hs-var">dfListComp</span></a></span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dfListComp&quot;</span></span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span id="local-6989586621681155130"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155130"><span class="hs-identifier hs-var">c_id</span></a></span></span><span> </span><span id="local-6989586621681155129"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155129"><span class="hs-identifier hs-var">n_id</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155128"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155128"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155127"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155127"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">quals</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155126"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155126"><span class="hs-identifier hs-var">core_body</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExprNoLP"><span class="hs-identifier hs-var">dsLExprNoLP</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155128"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-334"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155130"><span class="hs-identifier hs-var">c_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155126"><span class="hs-identifier hs-var">core_body</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155129"><span class="hs-identifier hs-var">n_id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span>        </span><span class="hs-comment">-- Non-last: must be a guard</span><span>
</span><span id="line-337"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span id="local-6989586621681155125"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155125"><span class="hs-identifier hs-var">c_id</span></a></span></span><span> </span><span id="local-6989586621681155124"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155124"><span class="hs-identifier hs-var">n_id</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155123"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155123"><span class="hs-identifier hs-var">guard</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span>  </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155122"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155122"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-338"></span><span>    </span><span id="local-6989586621681155121"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155121"><span class="hs-identifier hs-var">core_guard</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155123"><span class="hs-identifier hs-var">guard</span></a></span><span>
</span><span id="line-339"></span><span>    </span><span id="local-6989586621681155120"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155120"><span class="hs-identifier hs-var">core_rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; [ExprStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155125"><span class="hs-identifier hs-var">c_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155124"><span class="hs-identifier hs-var">n_id</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155122"><span class="hs-identifier hs-var">quals</span></a></span><span>
</span><span id="line-340"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIfThenElse"><span class="hs-identifier hs-var">mkIfThenElse</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155121"><span class="hs-identifier hs-var">core_guard</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155120"><span class="hs-identifier hs-var">core_rest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155124"><span class="hs-identifier hs-var">n_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span id="local-6989586621681155119"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155119"><span class="hs-identifier hs-var">c_id</span></a></span></span><span> </span><span id="local-6989586621681155118"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155118"><span class="hs-identifier hs-var">n_id</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LetStmt"><span class="hs-identifier hs-type">LetStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLetStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155117"><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc
</span><a href="#local-6989586621681155117"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155116"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155116"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-343"></span><span>    </span><span class="hs-comment">-- new in 1.3, local bindings</span><span>
</span><span id="line-344"></span><span>    </span><span id="local-6989586621681155115"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155115"><span class="hs-identifier hs-var">core_rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; [ExprStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155119"><span class="hs-identifier hs-var">c_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155118"><span class="hs-identifier hs-var">n_id</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155116"><span class="hs-identifier hs-var">quals</span></a></span><span>
</span><span id="line-345"></span><span>    </span><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier hs-var">dsLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc
</span><a href="#local-6989586621681155117"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155115"><span class="hs-identifier hs-var">core_rest</span></a></span><span>
</span><span id="line-346"></span><span>
</span><span id="line-347"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span id="local-6989586621681155114"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155114"><span class="hs-identifier hs-var">c_id</span></a></span></span><span> </span><span id="local-6989586621681155113"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155113"><span class="hs-identifier hs-var">n_id</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155112"><span class="annot"><span class="annottext">stmt :: ExprStmt GhcTc
</span><a href="#local-6989586621681155112"><span class="hs-identifier hs-var">stmt</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155111"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155111"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-348"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155110"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155110"><span class="hs-identifier hs-var">inner_list_expr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155109"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681155109"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExprStmt GhcTc -&gt; DsM (CoreExpr, LPat GhcTc)
</span><a href="GHC.HsToCore.ListComp.html#dsTransStmt"><span class="hs-identifier hs-var">dsTransStmt</span></a></span><span> </span><span class="annot"><span class="annottext">ExprStmt GhcTc
</span><a href="#local-6989586621681155112"><span class="hs-identifier hs-var">stmt</span></a></span><span>
</span><span id="line-349"></span><span>    </span><span class="hs-comment">-- Anyway, we bind the newly grouped list via the generic binding function</span><span>
</span><span id="line-350"></span><span>    </span><span class="annot"><span class="annottext">Id
-&gt; Id -&gt; (LPat GhcTc, CoreExpr) -&gt; [ExprStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dfBindComp"><span class="hs-identifier hs-var">dfBindComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155114"><span class="hs-identifier hs-var">c_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155113"><span class="hs-identifier hs-var">n_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681155109"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155110"><span class="hs-identifier hs-var">inner_list_expr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155111"><span class="hs-identifier hs-var">quals</span></a></span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span id="local-6989586621681155107"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155107"><span class="hs-identifier hs-var">c_id</span></a></span></span><span> </span><span id="local-6989586621681155106"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155106"><span class="hs-identifier hs-var">n_id</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155105"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155105"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681155104"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155104"><span class="hs-identifier hs-var">list1</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155103"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155103"><span class="hs-identifier hs-var">quals</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-353"></span><span>    </span><span class="hs-comment">-- evaluate the two lists</span><span>
</span><span id="line-354"></span><span>    </span><span id="local-6989586621681155102"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155102"><span class="hs-identifier hs-var">core_list1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155104"><span class="hs-identifier hs-var">list1</span></a></span><span>
</span><span id="line-355"></span><span>
</span><span id="line-356"></span><span>    </span><span class="hs-comment">-- Do the rest of the work in the generic binding builder</span><span>
</span><span id="line-357"></span><span>    </span><span class="annot"><span class="annottext">Id
-&gt; Id -&gt; (LPat GhcTc, CoreExpr) -&gt; [ExprStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dfBindComp"><span class="hs-identifier hs-var">dfBindComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155107"><span class="hs-identifier hs-var">c_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155106"><span class="hs-identifier hs-var">n_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155105"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155102"><span class="hs-identifier hs-var">core_list1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155103"><span class="hs-identifier hs-var">quals</span></a></span><span>
</span><span id="line-358"></span><span>
</span><span id="line-359"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-type">ParStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dfListComp ParStmt&quot;</span></span><span>
</span><span id="line-360"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#RecStmt"><span class="hs-identifier hs-type">RecStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dfListComp RecStmt&quot;</span></span><span>
</span><span id="line-361"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeStmt"><span class="hs-identifier hs-type">ApplicativeStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-362"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dfListComp ApplicativeStmt&quot;</span></span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dfBindComp"><span class="hs-identifier hs-type">dfBindComp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>             </span><span class="hs-comment">-- 'c' and 'n'</span><span>
</span><span id="line-365"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprStmt"><span class="hs-identifier hs-type">ExprStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- the rest of the qual's</span><span>
</span><span id="line-367"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-368"></span><span id="dfBindComp"><span class="annot"><span class="annottext">dfBindComp :: Id
-&gt; Id -&gt; (LPat GhcTc, CoreExpr) -&gt; [ExprStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dfBindComp"><span class="hs-identifier hs-var hs-var">dfBindComp</span></a></span></span><span> </span><span id="local-6989586621681155101"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155101"><span class="hs-identifier hs-var">c_id</span></a></span></span><span> </span><span id="local-6989586621681155100"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155100"><span class="hs-identifier hs-var">n_id</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155099"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155099"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155098"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155098"><span class="hs-identifier hs-var">core_list1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155097"><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155097"><span class="hs-identifier hs-var">quals</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-369"></span><span>    </span><span class="hs-comment">-- find the required type</span><span>
</span><span id="line-370"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155096"><span class="annot"><span class="annottext">x_ty :: Type
</span><a href="#local-6989586621681155096"><span class="hs-identifier hs-var hs-var">x_ty</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; Type
</span><a href="GHC.Tc.Utils.Zonk.html#hsLPatType"><span class="hs-identifier hs-var">hsLPatType</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155099"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-371"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155095"><span class="annot"><span class="annottext">b_ty :: Type
</span><a href="#local-6989586621681155095"><span class="hs-identifier hs-var hs-var">b_ty</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155100"><span class="hs-identifier hs-var">n_id</span></a></span><span>
</span><span id="line-372"></span><span>
</span><span id="line-373"></span><span>    </span><span class="hs-comment">-- create some new local id's</span><span>
</span><span id="line-374"></span><span>    </span><span id="local-6989586621681155094"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155094"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155095"><span class="hs-identifier hs-var">b_ty</span></a></span><span>
</span><span id="line-375"></span><span>    </span><span id="local-6989586621681155091"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155091"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155096"><span class="hs-identifier hs-var">x_ty</span></a></span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span>    </span><span class="hs-comment">-- build rest of the comprehension</span><span>
</span><span id="line-378"></span><span>    </span><span id="local-6989586621681155090"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155090"><span class="hs-identifier hs-var">core_rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; [ExprStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dfListComp"><span class="hs-identifier hs-var">dfListComp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155101"><span class="hs-identifier hs-var">c_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155094"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprStmt GhcTc]
</span><a href="#local-6989586621681155097"><span class="hs-identifier hs-var">quals</span></a></span><span>
</span><span id="line-379"></span><span>
</span><span id="line-380"></span><span>    </span><span class="hs-comment">-- build the pattern match</span><span>
</span><span id="line-381"></span><span>    </span><span id="local-6989586621681155089"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155089"><span class="hs-identifier hs-var">core_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.html#matchSimply"><span class="hs-identifier hs-var">matchSimply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155091"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
forall p. HsStmtContext p
</span><a href="GHC.Hs.Expr.html#ListComp"><span class="hs-identifier hs-var">ListComp</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-382"></span><span>                </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155099"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155090"><span class="hs-identifier hs-var">core_rest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155094"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span>    </span><span class="hs-comment">-- now build the outermost foldr, and return</span><span>
</span><span id="line-385"></span><span>    </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *).
MonadThings m =&gt;
Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkFoldrExpr"><span class="hs-identifier hs-var">mkFoldrExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155096"><span class="hs-identifier hs-var">x_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155095"><span class="hs-identifier hs-var">b_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155091"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155094"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155089"><span class="hs-identifier hs-var">core_expr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155100"><span class="hs-identifier hs-var">n_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155098"><span class="hs-identifier hs-var">core_list1</span></a></span><span>
</span><span id="line-386"></span><span>
</span><span id="line-387"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection[DsFunGeneration]{Generation of zip/unzip functions for use in desugaring}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-394"></span><span>
</span><span id="line-395"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#mkZipBind"><span class="hs-identifier hs-type">mkZipBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-396"></span><span class="hs-comment">-- mkZipBind [t1, t2]</span><span>
</span><span id="line-397"></span><span class="hs-comment">-- = (zip, \as1:[t1] as2:[t2]</span><span>
</span><span id="line-398"></span><span class="hs-comment">--         -&gt; case as1 of</span><span>
</span><span id="line-399"></span><span class="hs-comment">--              [] -&gt; []</span><span>
</span><span id="line-400"></span><span class="hs-comment">--              (a1:as'1) -&gt; case as2 of</span><span>
</span><span id="line-401"></span><span class="hs-comment">--                              [] -&gt; []</span><span>
</span><span id="line-402"></span><span class="hs-comment">--                              (a2:as'2) -&gt; (a1, a2) : zip as'1 as'2)]</span><span>
</span><span id="line-403"></span><span>
</span><span id="line-404"></span><span id="mkZipBind"><span class="annot"><span class="annottext">mkZipBind :: [Type] -&gt; DsM (Id, CoreExpr)
</span><a href="GHC.HsToCore.ListComp.html#mkZipBind"><span class="hs-identifier hs-var hs-var">mkZipBind</span></a></span></span><span> </span><span id="local-6989586621681155086"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155086"><span class="hs-identifier hs-var">elt_tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-405"></span><span>    </span><span id="local-6989586621681155085"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155085"><span class="hs-identifier hs-var">ass</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; DsM Id) -&gt; [Type] -&gt; DsM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155084"><span class="hs-identifier hs-var">elt_list_tys</span></a></span><span>
</span><span id="line-406"></span><span>    </span><span id="local-6989586621681155083"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155083"><span class="hs-identifier hs-var">as'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; DsM Id) -&gt; [Type] -&gt; DsM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155086"><span class="hs-identifier hs-var">elt_tys</span></a></span><span>
</span><span id="line-407"></span><span>    </span><span id="local-6989586621681155082"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155082"><span class="hs-identifier hs-var">as's</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; DsM Id) -&gt; [Type] -&gt; DsM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155084"><span class="hs-identifier hs-var">elt_list_tys</span></a></span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span>    </span><span id="local-6989586621681155081"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155081"><span class="hs-identifier hs-var">zip_fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155080"><span class="hs-identifier hs-var">zip_fn_ty</span></a></span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155079"><span class="annot"><span class="annottext">inner_rhs :: CoreExpr
</span><a href="#local-6989586621681155079"><span class="hs-identifier hs-var hs-var">inner_rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkConsExpr"><span class="hs-identifier hs-var">mkConsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155078"><span class="hs-identifier hs-var">elt_tuple_ty</span></a></span><span>
</span><span id="line-412"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155083"><span class="hs-identifier hs-var">as'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-413"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [Id] -&gt; CoreExpr
forall b. Expr b -&gt; [Id] -&gt; Expr b
</span><a href="GHC.Core.html#mkVarApps"><span class="hs-identifier hs-var">mkVarApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155081"><span class="hs-identifier hs-var">zip_fn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155082"><span class="hs-identifier hs-var">as's</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-414"></span><span>        </span><span id="local-6989586621681155075"><span class="annot"><span class="annottext">zip_body :: CoreExpr
</span><a href="#local-6989586621681155075"><span class="hs-identifier hs-var hs-var">zip_body</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Id, Id, Id) -&gt; CoreExpr -&gt; CoreExpr)
-&gt; CoreExpr -&gt; [(Id, Id, Id)] -&gt; CoreExpr
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, Id, Id) -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681155073"><span class="hs-identifier hs-var">mk_case</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155079"><span class="hs-identifier hs-var">inner_rhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; [Id] -&gt; [(Id, Id, Id)]
forall a b c. [a] -&gt; [b] -&gt; [c] -&gt; [(a, b, c)]
</span><a href="../../base/src/GHC.List.html#zip3"><span class="hs-identifier hs-var">zip3</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155085"><span class="hs-identifier hs-var">ass</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155083"><span class="hs-identifier hs-var">as'</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155082"><span class="hs-identifier hs-var">as's</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span>
</span><span id="line-416"></span><span>    </span><span class="annot"><span class="annottext">(Id, CoreExpr) -&gt; DsM (Id, CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155081"><span class="hs-identifier hs-var">zip_fn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155085"><span class="hs-identifier hs-var">ass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155075"><span class="hs-identifier hs-var">zip_body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-417"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-418"></span><span>    </span><span id="local-6989586621681155084"><span class="annot"><span class="annottext">elt_list_tys :: [Type]
</span><a href="#local-6989586621681155084"><span class="hs-identifier hs-var hs-var">elt_list_tys</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; [Type] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkListTy"><span class="hs-identifier hs-var">mkListTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155086"><span class="hs-identifier hs-var">elt_tys</span></a></span><span>
</span><span id="line-419"></span><span>    </span><span id="local-6989586621681155078"><span class="annot"><span class="annottext">elt_tuple_ty :: Type
</span><a href="#local-6989586621681155078"><span class="hs-identifier hs-var hs-var">elt_tuple_ty</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var">mkBigCoreTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155086"><span class="hs-identifier hs-var">elt_tys</span></a></span><span>
</span><span id="line-420"></span><span>    </span><span id="local-6989586621681155071"><span class="annot"><span class="annottext">elt_tuple_list_ty :: Type
</span><a href="#local-6989586621681155071"><span class="hs-identifier hs-var hs-var">elt_tuple_list_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkListTy"><span class="hs-identifier hs-var">mkListTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155078"><span class="hs-identifier hs-var">elt_tuple_ty</span></a></span><span>
</span><span id="line-421"></span><span>
</span><span id="line-422"></span><span>    </span><span id="local-6989586621681155080"><span class="annot"><span class="annottext">zip_fn_ty :: Type
</span><a href="#local-6989586621681155080"><span class="hs-identifier hs-var hs-var">zip_fn_ty</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155084"><span class="hs-identifier hs-var">elt_list_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155071"><span class="hs-identifier hs-var">elt_tuple_list_ty</span></a></span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span>    </span><span id="local-6989586621681155073"><span class="annot"><span class="annottext">mk_case :: (Id, Id, Id) -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681155073"><span class="hs-identifier hs-var hs-var">mk_case</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155069"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155069"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155068"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155068"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155067"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155067"><span class="hs-identifier hs-var">as'</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155066"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155066"><span class="hs-identifier hs-var">rest</span></a></span></span><span>
</span><span id="line-425"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; Type -&gt; [Alt Id] -&gt; CoreExpr
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155069"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155069"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155071"><span class="hs-identifier hs-var">elt_tuple_list_ty</span></a></span><span>
</span><span id="line-426"></span><span>                  </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#nilDataCon"><span class="hs-identifier hs-var">nilDataCon</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>        </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkNilExpr"><span class="hs-identifier hs-var">mkNilExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155078"><span class="hs-identifier hs-var">elt_tuple_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-427"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#consDataCon"><span class="hs-identifier hs-var">consDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155068"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155067"><span class="hs-identifier hs-var">as'</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155066"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-428"></span><span>                        </span><span class="hs-comment">-- Increasing order of tag</span><span>
</span><span id="line-429"></span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#mkUnzipBind"><span class="hs-identifier hs-type">mkUnzipBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#TransForm"><span class="hs-identifier hs-type">TransForm</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span class="hs-comment">-- mkUnzipBind [t1, t2]</span><span>
</span><span id="line-433"></span><span class="hs-comment">-- = (unzip, \ys :: [(t1, t2)] -&gt; foldr (\ax :: (t1, t2) axs :: ([t1], [t2])</span><span>
</span><span id="line-434"></span><span class="hs-comment">--     -&gt; case ax of</span><span>
</span><span id="line-435"></span><span class="hs-comment">--      (x1, x2) -&gt; case axs of</span><span>
</span><span id="line-436"></span><span class="hs-comment">--                (xs1, xs2) -&gt; (x1 : xs1, x2 : xs2))</span><span>
</span><span id="line-437"></span><span class="hs-comment">--      ([], [])</span><span>
</span><span id="line-438"></span><span class="hs-comment">--      ys)</span><span>
</span><span id="line-439"></span><span class="hs-comment">--</span><span>
</span><span id="line-440"></span><span class="hs-comment">-- We use foldr here in all cases, even if rules are turned off, because we may as well!</span><span>
</span><span id="line-441"></span><span id="mkUnzipBind"><span class="annot"><span class="annottext">mkUnzipBind :: TransForm -&gt; [Type] -&gt; DsM (Maybe (Id, CoreExpr))
</span><a href="GHC.HsToCore.ListComp.html#mkUnzipBind"><span class="hs-identifier hs-var hs-var">mkUnzipBind</span></a></span></span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="GHC.Hs.Expr.html#ThenForm"><span class="hs-identifier hs-var">ThenForm</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-442"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, CoreExpr) -&gt; DsM (Maybe (Id, CoreExpr))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Id, CoreExpr)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>    </span><span class="hs-comment">-- No unzipping for ThenForm</span><span>
</span><span id="line-443"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#mkUnzipBind"><span class="hs-identifier hs-var">mkUnzipBind</span></a></span><span> </span><span class="annot"><span class="annottext">TransForm
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155064"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155064"><span class="hs-identifier hs-var">elt_tys</span></a></span></span><span>
</span><span id="line-444"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155063"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155063"><span class="hs-identifier hs-var">ax</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155062"><span class="hs-identifier hs-var">elt_tuple_ty</span></a></span><span>
</span><span id="line-445"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155061"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155061"><span class="hs-identifier hs-var">axs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155060"><span class="hs-identifier hs-var">elt_list_tuple_ty</span></a></span><span>
</span><span id="line-446"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155059"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155059"><span class="hs-identifier hs-var">ys</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155058"><span class="hs-identifier hs-var">elt_tuple_list_ty</span></a></span><span>
</span><span id="line-447"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155057"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155057"><span class="hs-identifier hs-var">xs</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; DsM Id) -&gt; [Type] -&gt; DsM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155064"><span class="hs-identifier hs-var">elt_tys</span></a></span><span>
</span><span id="line-448"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155056"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155056"><span class="hs-identifier hs-var">xss</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; DsM Id) -&gt; [Type] -&gt; DsM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155055"><span class="hs-identifier hs-var">elt_list_tys</span></a></span><span>
</span><span id="line-449"></span><span>
</span><span id="line-450"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155054"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155054"><span class="hs-identifier hs-var">unzip_fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155053"><span class="hs-identifier hs-var">unzip_fn_ty</span></a></span><span>
</span><span id="line-451"></span><span>
</span><span id="line-452"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681155052"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681155052"><span class="hs-identifier hs-var">us1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155051"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681155051"><span class="hs-identifier hs-var">us2</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[IOEnv (Env DsGblEnv DsLclEnv) UniqSupply]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [UniqSupply]
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-453"></span><span>
</span><span id="line-454"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155048"><span class="annot"><span class="annottext">nil_tuple :: CoreExpr
</span><a href="#local-6989586621681155048"><span class="hs-identifier hs-var hs-var">nil_tuple</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var">mkBigCoreTup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Type -&gt; CoreExpr) -&gt; [Type] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkNilExpr"><span class="hs-identifier hs-var">mkNilExpr</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155064"><span class="hs-identifier hs-var">elt_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-455"></span><span>             </span><span id="local-6989586621681155046"><span class="annot"><span class="annottext">concat_expressions :: [CoreExpr]
</span><a href="#local-6989586621681155046"><span class="hs-identifier hs-var hs-var">concat_expressions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Type, CoreExpr, CoreExpr) -&gt; CoreExpr)
-&gt; [(Type, CoreExpr, CoreExpr)] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Type, CoreExpr, CoreExpr) -&gt; CoreExpr
</span><a href="#local-6989586621681155045"><span class="hs-identifier hs-var">mkConcatExpression</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; [CoreExpr] -&gt; [CoreExpr] -&gt; [(Type, CoreExpr, CoreExpr)]
forall a b c. [a] -&gt; [b] -&gt; [c] -&gt; [(a, b, c)]
</span><a href="../../base/src/GHC.List.html#zip3"><span class="hs-identifier hs-var">zip3</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155064"><span class="hs-identifier hs-var">elt_tys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; CoreExpr) -&gt; [Id] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155057"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; CoreExpr) -&gt; [Id] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155056"><span class="hs-identifier hs-var">xss</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span>             </span><span id="local-6989586621681155044"><span class="annot"><span class="annottext">tupled_concat_expression :: CoreExpr
</span><a href="#local-6989586621681155044"><span class="hs-identifier hs-var hs-var">tupled_concat_expression</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var">mkBigCoreTup</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155046"><span class="hs-identifier hs-var">concat_expressions</span></a></span><span>
</span><span id="line-457"></span><span>
</span><span id="line-458"></span><span>             </span><span id="local-6989586621681155043"><span class="annot"><span class="annottext">folder_body_inner_case :: CoreExpr
</span><a href="#local-6989586621681155043"><span class="hs-identifier hs-var hs-var">folder_body_inner_case</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleCase"><span class="hs-identifier hs-var">mkTupleCase</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681155052"><span class="hs-identifier hs-var">us1</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155056"><span class="hs-identifier hs-var">xss</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155044"><span class="hs-identifier hs-var">tupled_concat_expression</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155061"><span class="hs-identifier hs-var">axs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155061"><span class="hs-identifier hs-var">axs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-459"></span><span>             </span><span id="local-6989586621681155041"><span class="annot"><span class="annottext">folder_body_outer_case :: CoreExpr
</span><a href="#local-6989586621681155041"><span class="hs-identifier hs-var hs-var">folder_body_outer_case</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleCase"><span class="hs-identifier hs-var">mkTupleCase</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681155051"><span class="hs-identifier hs-var">us2</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155057"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155043"><span class="hs-identifier hs-var">folder_body_inner_case</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155063"><span class="hs-identifier hs-var">ax</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155063"><span class="hs-identifier hs-var">ax</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-460"></span><span>             </span><span id="local-6989586621681155040"><span class="annot"><span class="annottext">folder_body :: CoreExpr
</span><a href="#local-6989586621681155040"><span class="hs-identifier hs-var hs-var">folder_body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155063"><span class="hs-identifier hs-var">ax</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155061"><span class="hs-identifier hs-var">axs</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155041"><span class="hs-identifier hs-var">folder_body_outer_case</span></a></span><span>
</span><span id="line-461"></span><span>
</span><span id="line-462"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155039"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155039"><span class="hs-identifier hs-var">unzip_body</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *).
MonadThings m =&gt;
Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkFoldrExpr"><span class="hs-identifier hs-var">mkFoldrExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155062"><span class="hs-identifier hs-var">elt_tuple_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155060"><span class="hs-identifier hs-var">elt_list_tuple_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155040"><span class="hs-identifier hs-var">folder_body</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155048"><span class="hs-identifier hs-var">nil_tuple</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155059"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-463"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, CoreExpr) -&gt; DsM (Maybe (Id, CoreExpr))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id, CoreExpr) -&gt; Maybe (Id, CoreExpr)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155054"><span class="hs-identifier hs-var">unzip_fn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155059"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155039"><span class="hs-identifier hs-var">unzip_body</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-464"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-465"></span><span>    </span><span id="local-6989586621681155062"><span class="annot"><span class="annottext">elt_tuple_ty :: Type
</span><a href="#local-6989586621681155062"><span class="hs-identifier hs-var hs-var">elt_tuple_ty</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var">mkBigCoreTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155064"><span class="hs-identifier hs-var">elt_tys</span></a></span><span>
</span><span id="line-466"></span><span>    </span><span id="local-6989586621681155058"><span class="annot"><span class="annottext">elt_tuple_list_ty :: Type
</span><a href="#local-6989586621681155058"><span class="hs-identifier hs-var hs-var">elt_tuple_list_ty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkListTy"><span class="hs-identifier hs-var">mkListTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155062"><span class="hs-identifier hs-var">elt_tuple_ty</span></a></span><span>
</span><span id="line-467"></span><span>    </span><span id="local-6989586621681155055"><span class="annot"><span class="annottext">elt_list_tys :: [Type]
</span><a href="#local-6989586621681155055"><span class="hs-identifier hs-var hs-var">elt_list_tys</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; [Type] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkListTy"><span class="hs-identifier hs-var">mkListTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155064"><span class="hs-identifier hs-var">elt_tys</span></a></span><span>
</span><span id="line-468"></span><span>    </span><span id="local-6989586621681155060"><span class="annot"><span class="annottext">elt_list_tuple_ty :: Type
</span><a href="#local-6989586621681155060"><span class="hs-identifier hs-var hs-var">elt_list_tuple_ty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var">mkBigCoreTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155055"><span class="hs-identifier hs-var">elt_list_tys</span></a></span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span>    </span><span id="local-6989586621681155053"><span class="annot"><span class="annottext">unzip_fn_ty :: Type
</span><a href="#local-6989586621681155053"><span class="hs-identifier hs-var hs-var">unzip_fn_ty</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155058"><span class="hs-identifier hs-var">elt_tuple_list_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155060"><span class="hs-identifier hs-var">elt_list_tuple_ty</span></a></span><span>
</span><span id="line-471"></span><span>
</span><span id="line-472"></span><span>    </span><span id="local-6989586621681155045"><span class="annot"><span class="annottext">mkConcatExpression :: (Type, CoreExpr, CoreExpr) -&gt; CoreExpr
</span><a href="#local-6989586621681155045"><span class="hs-identifier hs-var hs-var">mkConcatExpression</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155038"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155038"><span class="hs-identifier hs-var">list_element_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155037"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155037"><span class="hs-identifier hs-var">head</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155036"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155036"><span class="hs-identifier hs-var">tail</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkConsExpr"><span class="hs-identifier hs-var">mkConsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155038"><span class="hs-identifier hs-var">list_element_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155037"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155036"><span class="hs-identifier hs-var">tail</span></a></span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span class="hs-comment">-- Translation for monad comprehensions</span><span>
</span><span id="line-475"></span><span>
</span><span id="line-476"></span><span class="hs-comment">-- Entry point for monad comprehension desugaring</span><span>
</span><span id="line-477"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMonadComp"><span class="hs-identifier hs-type">dsMonadComp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprLStmt"><span class="hs-identifier hs-type">ExprLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-478"></span><span id="dsMonadComp"><span class="annot"><span class="annottext">dsMonadComp :: [ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMonadComp"><span class="hs-identifier hs-var hs-var">dsMonadComp</span></a></span></span><span> </span><span id="local-6989586621681155035"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155035"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-var">dsMcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155035"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-type">dsMcStmts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprLStmt"><span class="hs-identifier hs-type">ExprLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-481"></span><span id="dsMcStmts"><span class="annot"><span class="annottext">dsMcStmts :: [ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-var hs-var">dsMcStmts</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>                      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsMcStmts&quot;</span></span><span>
</span><span id="line-482"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-var">dsMcStmts</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681155032"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681155032"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681155031"><span class="annot"><span class="annottext">ExprStmt GhcTc
</span><a href="#local-6989586621681155031"><span class="hs-identifier hs-var">stmt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681155030"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155030"><span class="hs-identifier hs-var">lstmts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; DsM CoreExpr -&gt; DsM CoreExpr
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681155032"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExprStmt GhcTc -&gt; [ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-var">dsMcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">ExprStmt GhcTc
</span><a href="#local-6989586621681155031"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155030"><span class="hs-identifier hs-var">lstmts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-483"></span><span>
</span><span id="line-484"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-485"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-type">dsMcStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ExprStmt"><span class="hs-identifier hs-type">ExprStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprLStmt"><span class="hs-identifier hs-type">ExprLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-486"></span><span>
</span><span id="line-487"></span><span id="dsMcStmt"><span class="annot"><span class="annottext">dsMcStmt :: ExprStmt GhcTc -&gt; [ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-var hs-var">dsMcStmt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155027"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155027"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155026"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681155026"><span class="hs-identifier hs-var">ret_op</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155025"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155025"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-488"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">stmts</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-489"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155024"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155024"><span class="hs-identifier hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155027"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-490"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681155026"><span class="hs-identifier hs-var">ret_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155024"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-491"></span><span>
</span><span id="line-492"></span><span class="hs-comment">--   [ .. | let binds, stmts ]</span><span>
</span><span id="line-493"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-var">dsMcStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LetStmt"><span class="hs-identifier hs-type">LetStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLetStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155023"><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc
</span><a href="#local-6989586621681155023"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155022"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155022"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-494"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155021"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155021"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-var">dsMcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155022"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-495"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier hs-var">dsLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsLocalBindsLR GhcTc GhcTc
</span><a href="#local-6989586621681155023"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155021"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-496"></span><span>
</span><span id="line-497"></span><span class="hs-comment">--   [ .. | a &lt;- m, stmts ]</span><span>
</span><span id="line-498"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-var">dsMcStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span id="local-6989586621681155020"><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681155020"><span class="hs-identifier hs-var">xbs</span></a></span></span><span> </span><span id="local-6989586621681155019"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155019"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681155018"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155018"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155017"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155017"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-499"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155016"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155016"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155018"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-500"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
-&gt; CoreExpr
-&gt; SyntaxExpr GhcTc
-&gt; Maybe (SyntaxExpr GhcTc)
-&gt; Type
-&gt; [ExprLStmt GhcTc]
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcBindStmt"><span class="hs-identifier hs-var">dsMcBindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681155019"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155016"><span class="hs-identifier hs-var">rhs'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmtTc -&gt; SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#xbstc_bindOp"><span class="hs-identifier hs-var hs-var">xbstc_bindOp</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
XBindStmtTc
</span><a href="#local-6989586621681155020"><span class="hs-identifier hs-var">xbs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmtTc -&gt; Maybe (SyntaxExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#xbstc_failOp"><span class="hs-identifier hs-var hs-var">xbstc_failOp</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
XBindStmtTc
</span><a href="#local-6989586621681155020"><span class="hs-identifier hs-var">xbs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmtTc -&gt; Type
</span><a href="GHC.Hs.Expr.html#xbstc_boundResultType"><span class="hs-identifier hs-var hs-var">xbstc_boundResultType</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
XBindStmtTc
</span><a href="#local-6989586621681155020"><span class="hs-identifier hs-var">xbs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155017"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-501"></span><span>
</span><span id="line-502"></span><span class="hs-comment">-- Apply `guard` to the `exp` expression</span><span>
</span><span id="line-503"></span><span class="hs-comment">--</span><span>
</span><span id="line-504"></span><span class="hs-comment">--   [ .. | exp, stmts ]</span><span>
</span><span id="line-505"></span><span class="hs-comment">--</span><span>
</span><span id="line-506"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-var">dsMcStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155011"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155011"><span class="hs-identifier hs-var">exp</span></a></span></span><span> </span><span id="local-6989586621681155010"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681155010"><span class="hs-identifier hs-var">then_exp</span></a></span></span><span> </span><span id="local-6989586621681155009"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681155009"><span class="hs-identifier hs-var">guard_exp</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155008"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155008"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-507"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681155007"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155007"><span class="hs-identifier hs-var">exp'</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155011"><span class="hs-identifier hs-var">exp</span></a></span><span>
</span><span id="line-508"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155006"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155006"><span class="hs-identifier hs-var">rest</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-var">dsMcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155008"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-509"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681155005"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155005"><span class="hs-identifier hs-var">guard_exp'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681155009"><span class="hs-identifier hs-var">guard_exp</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155007"><span class="hs-identifier hs-var">exp'</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-510"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681155010"><span class="hs-identifier hs-var">then_exp</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155005"><span class="hs-identifier hs-var">guard_exp'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155006"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-511"></span><span>
</span><span id="line-512"></span><span class="hs-comment">-- Group statements desugar like this:</span><span>
</span><span id="line-513"></span><span class="hs-comment">--</span><span>
</span><span id="line-514"></span><span class="hs-comment">--   [| (q, then group by e using f); rest |]</span><span>
</span><span id="line-515"></span><span class="hs-comment">--   ---&gt;  f {qt} (\qv -&gt; e) [| q; return qv |] &gt;&gt;= \ n_tup -&gt;</span><span>
</span><span id="line-516"></span><span class="hs-comment">--         case unzip n_tup of qv' -&gt; [| rest |]</span><span>
</span><span id="line-517"></span><span class="hs-comment">--</span><span>
</span><span id="line-518"></span><span class="hs-comment">-- where   variables (v1:t1, ..., vk:tk) are bound by q</span><span>
</span><span id="line-519"></span><span class="hs-comment">--         qv = (v1, ..., vk)</span><span>
</span><span id="line-520"></span><span class="hs-comment">--         qt = (t1, ..., tk)</span><span>
</span><span id="line-521"></span><span class="hs-comment">--         (&gt;&gt;=) :: m2 a -&gt; (a -&gt; m3 b) -&gt; m3 b</span><span>
</span><span id="line-522"></span><span class="hs-comment">--         f :: forall a. (a -&gt; t) -&gt; m1 a -&gt; m2 (n a)</span><span>
</span><span id="line-523"></span><span class="hs-comment">--         n_tup :: n qt</span><span>
</span><span id="line-524"></span><span class="hs-comment">--         unzip :: n qt -&gt; (n t1, ..., n tk)    (needs Functor n)</span><span>
</span><span id="line-525"></span><span>
</span><span id="line-526"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-var">dsMcStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">trS_stmts :: forall idL idR body. StmtLR idL idR body -&gt; [ExprLStmt idL]
</span><a href="GHC.Hs.Expr.html#trS_stmts"><span class="hs-identifier hs-var">trS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155004"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155004"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bndrs :: forall idL idR body. StmtLR idL idR body -&gt; [(IdP idR, IdP idR)]
</span><a href="GHC.Hs.Expr.html#trS_bndrs"><span class="hs-identifier hs-var">trS_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155003"><span class="annot"><span class="annottext">[(IdP GhcTc, IdP GhcTc)]
</span><a href="#local-6989586621681155003"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span>
</span><span id="line-527"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_by :: forall idL idR body. StmtLR idL idR body -&gt; Maybe (LHsExpr idR)
</span><a href="GHC.Hs.Expr.html#trS_by"><span class="hs-identifier hs-var">trS_by</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155002"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681155002"><span class="hs-identifier hs-var">by</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_using :: forall idL idR body. StmtLR idL idR body -&gt; LHsExpr idR
</span><a href="GHC.Hs.Expr.html#trS_using"><span class="hs-identifier hs-var">trS_using</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155001"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155001"><span class="hs-identifier hs-var">using</span></a></span></span><span>
</span><span id="line-528"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_ret :: forall idL idR body. StmtLR idL idR body -&gt; SyntaxExpr idR
</span><a href="GHC.Hs.Expr.html#trS_ret"><span class="hs-identifier hs-var">trS_ret</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681154999"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154999"><span class="hs-identifier hs-var">return_op</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bind :: forall idL idR body. StmtLR idL idR body -&gt; SyntaxExpr idR
</span><a href="GHC.Hs.Expr.html#trS_bind"><span class="hs-identifier hs-var">trS_bind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681154997"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154997"><span class="hs-identifier hs-var">bind_op</span></a></span></span><span>
</span><span id="line-529"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_ext :: forall idL idR body. StmtLR idL idR body -&gt; XTransStmt idL idR body
</span><a href="GHC.Hs.Expr.html#trS_ext"><span class="hs-identifier hs-var">trS_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681154995"><span class="annot"><span class="annottext">XTransStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681154995"><span class="hs-identifier hs-var">n_tup_ty'</span></a></span></span><span>  </span><span class="hs-comment">-- n (a,b,c)</span><span>
</span><span id="line-530"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_fmap :: forall idL idR body. StmtLR idL idR body -&gt; HsExpr idR
</span><a href="GHC.Hs.Expr.html#trS_fmap"><span class="hs-identifier hs-var">trS_fmap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681154993"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681154993"><span class="hs-identifier hs-var">fmap_op</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_form :: forall idL idR body. StmtLR idL idR body -&gt; TransForm
</span><a href="GHC.Hs.Expr.html#trS_form"><span class="hs-identifier hs-var">trS_form</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681154992"><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681154992"><span class="hs-identifier hs-var">form</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681154991"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154991"><span class="hs-identifier hs-var">stmts_rest</span></a></span></span><span>
</span><span id="line-531"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681154990"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154990"><span class="hs-identifier hs-var">from_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681154989"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154989"><span class="hs-identifier hs-var">to_bndrs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Id)] -&gt; ([Id], [Id])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Id)]
[(IdP GhcTc, IdP GhcTc)]
</span><a href="#local-6989586621681155003"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-532"></span><span>
</span><span id="line-533"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681154988"><span class="annot"><span class="annottext">from_bndr_tys :: [Type]
</span><a href="#local-6989586621681154988"><span class="hs-identifier hs-var hs-var">from_bndr_tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Type) -&gt; [Id] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154990"><span class="hs-identifier hs-var">from_bndrs</span></a></span><span>     </span><span class="hs-comment">-- Types ty</span><span>
</span><span id="line-534"></span><span>
</span><span id="line-535"></span><span>
</span><span id="line-536"></span><span>       </span><span class="hs-comment">-- Desugar an inner comprehension which outputs a list of tuples of the &quot;from&quot; binders</span><span>
</span><span id="line-537"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154987"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154987"><span class="hs-identifier hs-var">expr'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; [Id] -&gt; SyntaxExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsInnerMonadComp"><span class="hs-identifier hs-var">dsInnerMonadComp</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681155004"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154990"><span class="hs-identifier hs-var">from_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154999"><span class="hs-identifier hs-var">return_op</span></a></span><span>
</span><span id="line-538"></span><span>
</span><span id="line-539"></span><span>       </span><span class="hs-comment">-- Work out what arguments should be supplied to that expression: i.e. is an extraction</span><span>
</span><span id="line-540"></span><span>       </span><span class="hs-comment">-- function required? If so, create that desugared function and add to arguments</span><span>
</span><span id="line-541"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154985"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154985"><span class="hs-identifier hs-var">usingExpr'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681155001"><span class="hs-identifier hs-var">using</span></a></span><span>
</span><span id="line-542"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154984"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681154984"><span class="hs-identifier hs-var">usingArgs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681155002"><span class="hs-identifier hs-var">by</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-543"></span><span>                         </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154987"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-544"></span><span>                         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681154983"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681154983"><span class="hs-identifier hs-var">by_e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681154982"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154982"><span class="hs-identifier hs-var">by_e'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681154983"><span class="hs-identifier hs-var">by_e</span></a></span><span>
</span><span id="line-545"></span><span>                                         </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154981"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154981"><span class="hs-identifier hs-var">lam'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#matchTuple"><span class="hs-identifier hs-var">matchTuple</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154990"><span class="hs-identifier hs-var">from_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154982"><span class="hs-identifier hs-var">by_e'</span></a></span><span>
</span><span id="line-546"></span><span>                                         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154981"><span class="hs-identifier hs-var">lam'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154987"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-547"></span><span>
</span><span id="line-548"></span><span>       </span><span class="hs-comment">-- Generate the expressions to build the grouped list</span><span>
</span><span id="line-549"></span><span>       </span><span class="hs-comment">-- Build a pattern that ensures the consumer binds into the NEW binders,</span><span>
</span><span id="line-550"></span><span>       </span><span class="hs-comment">-- which hold monads rather than single values</span><span>
</span><span id="line-551"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681154980"><span class="annot"><span class="annottext">tup_n_ty' :: Type
</span><a href="#local-6989586621681154980"><span class="hs-identifier hs-var hs-var">tup_n_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154989"><span class="hs-identifier hs-var">to_bndrs</span></a></span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154979"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154979"><span class="hs-identifier hs-var">body</span></a></span></span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-var">dsMcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154991"><span class="hs-identifier hs-var">stmts_rest</span></a></span><span>
</span><span id="line-554"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154978"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154978"><span class="hs-identifier hs-var">n_tup_var'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDsNoLP"><span class="hs-identifier hs-var">newSysLocalDsNoLP</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XTransStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681154995"><span class="hs-identifier hs-var">n_tup_ty'</span></a></span><span>
</span><span id="line-555"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154976"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154976"><span class="hs-identifier hs-var">tup_n_var'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154980"><span class="hs-identifier hs-var">tup_n_ty'</span></a></span><span>
</span><span id="line-556"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154975"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154975"><span class="hs-identifier hs-var">tup_n_expr'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TransForm -&gt; HsExpr GhcTc -&gt; Id -&gt; [Type] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#mkMcUnzipM"><span class="hs-identifier hs-var">mkMcUnzipM</span></a></span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681154992"><span class="hs-identifier hs-var">form</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681154993"><span class="hs-identifier hs-var">fmap_op</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154978"><span class="hs-identifier hs-var">n_tup_var'</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681154988"><span class="hs-identifier hs-var">from_bndr_tys</span></a></span><span>
</span><span id="line-557"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154973"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681154973"><span class="hs-identifier hs-var">us</span></a></span></span><span>          </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span>
</span><span id="line-558"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681154972"><span class="annot"><span class="annottext">rhs' :: CoreExpr
</span><a href="#local-6989586621681154972"><span class="hs-identifier hs-var hs-var">rhs'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154985"><span class="hs-identifier hs-var">usingExpr'</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681154984"><span class="hs-identifier hs-var">usingArgs'</span></a></span><span>
</span><span id="line-559"></span><span>             </span><span id="local-6989586621681154971"><span class="annot"><span class="annottext">body' :: CoreExpr
</span><a href="#local-6989586621681154971"><span class="hs-identifier hs-var hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleCase"><span class="hs-identifier hs-var">mkTupleCase</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681154973"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154989"><span class="hs-identifier hs-var">to_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154979"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154976"><span class="hs-identifier hs-var">tup_n_var'</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154975"><span class="hs-identifier hs-var">tup_n_expr'</span></a></span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154997"><span class="hs-identifier hs-var">bind_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154972"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154978"><span class="hs-identifier hs-var">n_tup_var'</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154971"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-562"></span><span>
</span><span id="line-563"></span><span class="hs-comment">-- Parallel statements. Use `Control.Monad.Zip.mzip` to zip parallel</span><span>
</span><span id="line-564"></span><span class="hs-comment">-- statements, for example:</span><span>
</span><span id="line-565"></span><span class="hs-comment">--</span><span>
</span><span id="line-566"></span><span class="hs-comment">--   [ body | qs1 | qs2 | qs3 ]</span><span>
</span><span id="line-567"></span><span class="hs-comment">--     -&gt;  [ body | (bndrs1, (bndrs2, bndrs3))</span><span>
</span><span id="line-568"></span><span class="hs-comment">--                     &lt;- [bndrs1 | qs1] `mzip` ([bndrs2 | qs2] `mzip` [bndrs3 | qs3]) ]</span><span>
</span><span id="line-569"></span><span class="hs-comment">--</span><span>
</span><span id="line-570"></span><span class="hs-comment">-- where `mzip` has type</span><span>
</span><span id="line-571"></span><span class="hs-comment">--   mzip :: forall a b. m a -&gt; m b -&gt; m (a,b)</span><span>
</span><span id="line-572"></span><span class="hs-comment">-- NB: we need a polymorphic mzip because we call it several times</span><span>
</span><span id="line-573"></span><span>
</span><span id="line-574"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-var">dsMcStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-type">ParStmt</span></a></span><span> </span><span id="local-6989586621681154970"><span class="annot"><span class="annottext">XParStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681154970"><span class="hs-identifier hs-var">bind_ty</span></a></span></span><span> </span><span id="local-6989586621681154969"><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681154969"><span class="hs-identifier hs-var">blocks</span></a></span></span><span> </span><span id="local-6989586621681154968"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681154968"><span class="hs-identifier hs-var">mzip_op</span></a></span></span><span> </span><span id="local-6989586621681154967"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154967"><span class="hs-identifier hs-var">bind_op</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681154966"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154966"><span class="hs-identifier hs-var">stmts_rest</span></a></span></span><span>
</span><span id="line-575"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681154965"><span class="annot"><span class="annottext">[(CoreExpr, Type)]
</span><a href="#local-6989586621681154965"><span class="hs-identifier hs-var">exps_w_tys</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(ParStmtBlock GhcTc GhcTc -&gt; DsM (CoreExpr, Type))
-&gt; [ParStmtBlock GhcTc GhcTc]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [(CoreExpr, Type)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">ParStmtBlock GhcTc GhcTc -&gt; DsM (CoreExpr, Type)
</span><a href="#local-6989586621681154964"><span class="hs-identifier hs-var">ds_inner</span></a></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681154969"><span class="hs-identifier hs-var">blocks</span></a></span><span>   </span><span class="hs-comment">-- Pairs (exp :: m ty, ty)</span><span>
</span><span id="line-576"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154963"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154963"><span class="hs-identifier hs-var">mzip_op'</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier hs-var">dsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681154968"><span class="hs-identifier hs-var">mzip_op</span></a></span><span>
</span><span id="line-577"></span><span>
</span><span id="line-578"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- The pattern variables</span><span>
</span><span id="line-579"></span><span>             </span><span id="local-6989586621681154962"><span class="annot"><span class="annottext">pats :: [Located (Pat GhcTc)]
</span><a href="#local-6989586621681154962"><span class="hs-identifier hs-var hs-var">pats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; LPat GhcTc
</span><a href="GHC.HsToCore.Utils.html#mkBigLHsVarPatTupId"><span class="hs-identifier hs-var">mkBigLHsVarPatTupId</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681154961"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmtBlock GhcTc GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681154961"><span class="annot"><span class="annottext">[IdP GhcTc]
</span><a href="#local-6989586621681154961"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681154969"><span class="hs-identifier hs-var">blocks</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-580"></span><span>             </span><span class="hs-comment">-- Pattern with tuples of variables</span><span>
</span><span id="line-581"></span><span>             </span><span class="hs-comment">-- [v1,v2,v3]  =&gt;  (v1, (v2, v3))</span><span>
</span><span id="line-582"></span><span>             </span><span id="local-6989586621681154960"><span class="annot"><span class="annottext">pat :: Located (Pat GhcTc)
</span><a href="#local-6989586621681154960"><span class="hs-identifier hs-var hs-var">pat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcTc) -&gt; Located (Pat GhcTc) -&gt; Located (Pat GhcTc))
-&gt; [Located (Pat GhcTc)] -&gt; Located (Pat GhcTc)
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681154958"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681154958"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span id="local-6989586621681154957"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681154957"><span class="hs-identifier hs-var">p2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[LPat GhcTc] -&gt; LPat GhcTc
</span><a href="GHC.HsToCore.Utils.html#mkLHsPatTup"><span class="hs-identifier hs-var">mkLHsPatTup</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681154958"><span class="hs-identifier hs-var">p1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681154957"><span class="hs-identifier hs-var">p2</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
</span><a href="#local-6989586621681154962"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-583"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681154955"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154955"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((CoreExpr, Type) -&gt; (CoreExpr, Type) -&gt; (CoreExpr, Type))
-&gt; [(CoreExpr, Type)] -&gt; (CoreExpr, Type)
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681154954"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154954"><span class="hs-identifier hs-var">e1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681154953"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154953"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681154952"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154952"><span class="hs-identifier hs-var">e2</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681154951"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154951"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-584"></span><span>                                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154963"><span class="hs-identifier hs-var">mzip_op'</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154953"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154951"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154954"><span class="hs-identifier hs-var">e1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154952"><span class="hs-identifier hs-var">e2</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-585"></span><span>                                  </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkBoxedTupleTy"><span class="hs-identifier hs-var">mkBoxedTupleTy</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154953"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154951"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-586"></span><span>                               </span><span class="annot"><span class="annottext">[(CoreExpr, Type)]
</span><a href="#local-6989586621681154965"><span class="hs-identifier hs-var">exps_w_tys</span></a></span><span>
</span><span id="line-587"></span><span>
</span><span id="line-588"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
-&gt; CoreExpr
-&gt; SyntaxExpr GhcTc
-&gt; Maybe (SyntaxExpr GhcTc)
-&gt; Type
-&gt; [ExprLStmt GhcTc]
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcBindStmt"><span class="hs-identifier hs-var">dsMcBindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681154960"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154955"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154967"><span class="hs-identifier hs-var">bind_op</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XParStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681154970"><span class="hs-identifier hs-var">bind_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154966"><span class="hs-identifier hs-var">stmts_rest</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-589"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-590"></span><span>    </span><span class="annot"><a href="#local-6989586621681154964"><span class="hs-identifier hs-type">ds_inner</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-591"></span><span>    </span><span id="local-6989586621681154964"><span class="annot"><span class="annottext">ds_inner :: ParStmtBlock GhcTc GhcTc -&gt; DsM (CoreExpr, Type)
</span><a href="#local-6989586621681154964"><span class="hs-identifier hs-var hs-var">ds_inner</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmtBlock GhcTc GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681154949"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154949"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681154948"><span class="annot"><span class="annottext">[IdP GhcTc]
</span><a href="#local-6989586621681154948"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span id="local-6989586621681154947"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154947"><span class="hs-identifier hs-var">return_op</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-592"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681154946"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154946"><span class="hs-identifier hs-var">exp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; [Id] -&gt; SyntaxExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsInnerMonadComp"><span class="hs-identifier hs-var">dsInnerMonadComp</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154949"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681154948"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154947"><span class="hs-identifier hs-var">return_op</span></a></span><span>
</span><span id="line-593"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CoreExpr, Type) -&gt; DsM (CoreExpr, Type)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154946"><span class="hs-identifier hs-var">exp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681154948"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-594"></span><span>
</span><span id="line-595"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcStmt"><span class="hs-identifier hs-var">dsMcStmt</span></a></span><span> </span><span id="local-6989586621681154945"><span class="annot"><span class="annottext">ExprStmt GhcTc
</span><a href="#local-6989586621681154945"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; DsM CoreExpr
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsMcStmt: unexpected stmt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExprStmt GhcTc -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ExprStmt GhcTc
</span><a href="#local-6989586621681154945"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-596"></span><span>
</span><span id="line-597"></span><span>
</span><span id="line-598"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#matchTuple"><span class="hs-identifier hs-type">matchTuple</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-599"></span><span class="hs-comment">-- (matchTuple [a,b,c] body)</span><span>
</span><span id="line-600"></span><span class="hs-comment">--       returns the Core term</span><span>
</span><span id="line-601"></span><span class="hs-comment">--  \x. case x of (a,b,c) -&gt; body</span><span>
</span><span id="line-602"></span><span id="matchTuple"><span class="annot"><span class="annottext">matchTuple :: [Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#matchTuple"><span class="hs-identifier hs-var hs-var">matchTuple</span></a></span></span><span> </span><span id="local-6989586621681154944"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154944"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681154943"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154943"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-603"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681154942"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681154942"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span>
</span><span id="line-604"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154941"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154941"><span class="hs-identifier hs-var">tup_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154944"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-605"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154941"><span class="hs-identifier hs-var">tup_id</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleCase"><span class="hs-identifier hs-var">mkTupleCase</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681154942"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154944"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154943"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154941"><span class="hs-identifier hs-var">tup_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154941"><span class="hs-identifier hs-var">tup_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-606"></span><span>
</span><span id="line-607"></span><span class="hs-comment">-- general `rhs' &gt;&gt;= \pat -&gt; stmts` desugaring where `rhs'` is already a</span><span>
</span><span id="line-608"></span><span class="hs-comment">-- desugared `CoreExpr`</span><span>
</span><span id="line-609"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsMcBindStmt"><span class="hs-identifier hs-type">dsMcBindStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-610"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>        </span><span class="hs-comment">-- ^ the desugared rhs of the bind statement</span><span>
</span><span id="line-611"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-612"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-613"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>            </span><span class="hs-comment">-- ^ S in (&gt;&gt;=) :: Q -&gt; (R -&gt; S) -&gt; T</span><span>
</span><span id="line-614"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprLStmt"><span class="hs-identifier hs-type">ExprLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-615"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-616"></span><span id="dsMcBindStmt"><span class="annot"><span class="annottext">dsMcBindStmt :: LPat GhcTc
-&gt; CoreExpr
-&gt; SyntaxExpr GhcTc
-&gt; Maybe (SyntaxExpr GhcTc)
-&gt; Type
-&gt; [ExprLStmt GhcTc]
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcBindStmt"><span class="hs-identifier hs-var hs-var">dsMcBindStmt</span></a></span></span><span> </span><span id="local-6989586621681154940"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681154940"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681154939"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154939"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span id="local-6989586621681154938"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154938"><span class="hs-identifier hs-var">bind_op</span></a></span></span><span> </span><span id="local-6989586621681154937"><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681154937"><span class="hs-identifier hs-var">fail_op</span></a></span></span><span> </span><span id="local-6989586621681154936"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154936"><span class="hs-identifier hs-var">res1_ty</span></a></span></span><span> </span><span id="local-6989586621681154935"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154935"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-617"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681154934"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154934"><span class="hs-identifier hs-var">body</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-var">dsMcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154935"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-618"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154933"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154933"><span class="hs-identifier hs-var">var</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; LPat GhcTc -&gt; DsM Id
</span><a href="GHC.HsToCore.Utils.html#selectSimpleMatchVarL"><span class="hs-identifier hs-var">selectSimpleMatchVarL</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681154940"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-619"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154931"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681154931"><span class="hs-identifier hs-var">match</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; Type
-&gt; MatchResult CoreExpr
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchSinglePatVar"><span class="hs-identifier hs-var">matchSinglePatVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154933"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ModuleName -&gt; HsStmtContext GhcRn
forall p. Maybe ModuleName -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#DoExpr"><span class="hs-identifier hs-var">DoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681154940"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-620"></span><span>                                  </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154936"><span class="hs-identifier hs-var">res1_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#cantFailMatchResult"><span class="hs-identifier hs-var">cantFailMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154934"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-621"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154927"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154927"><span class="hs-identifier hs-var">match_code</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
-&gt; MatchResult CoreExpr -&gt; Maybe (SyntaxExpr GhcTc) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsHandleMonadicFailure"><span class="hs-identifier hs-var">dsHandleMonadicFailure</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681154940"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681154931"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681154937"><span class="hs-identifier hs-var">fail_op</span></a></span><span>
</span><span id="line-622"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154938"><span class="hs-identifier hs-var">bind_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154939"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154933"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154927"><span class="hs-identifier hs-var">match_code</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-623"></span><span>
</span><span id="line-624"></span><span class="hs-comment">-- Desugar nested monad comprehensions, for example in `then..` constructs</span><span>
</span><span id="line-625"></span><span class="hs-comment">--    dsInnerMonadComp quals [a,b,c] ret_op</span><span>
</span><span id="line-626"></span><span class="hs-comment">-- returns the desugaring of</span><span>
</span><span id="line-627"></span><span class="hs-comment">--       [ (a,b,c) | quals ]</span><span>
</span><span id="line-628"></span><span>
</span><span id="line-629"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#dsInnerMonadComp"><span class="hs-identifier hs-type">dsInnerMonadComp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#ExprLStmt"><span class="hs-identifier hs-type">ExprLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-630"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>               </span><span class="hs-comment">-- Return a tuple of these variables</span><span>
</span><span id="line-631"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>   </span><span class="hs-comment">-- The monomorphic &quot;return&quot; operator</span><span>
</span><span id="line-632"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-633"></span><span id="dsInnerMonadComp"><span class="annot"><span class="annottext">dsInnerMonadComp :: [ExprLStmt GhcTc] -&gt; [Id] -&gt; SyntaxExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsInnerMonadComp"><span class="hs-identifier hs-var hs-var">dsInnerMonadComp</span></a></span></span><span> </span><span id="local-6989586621681154926"><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154926"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681154925"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154925"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span id="local-6989586621681154924"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154924"><span class="hs-identifier hs-var">ret_op</span></a></span></span><span>
</span><span id="line-634"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#dsMcStmts"><span class="hs-identifier hs-var">dsMcStmts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ExprLStmt GhcTc]
</span><a href="#local-6989586621681154926"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">[ExprLStmt GhcTc] -&gt; [ExprLStmt GhcTc] -&gt; [ExprLStmt GhcTc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-635"></span><span>                 </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ExprStmt GhcTc -&gt; ExprLStmt GhcTc
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; Maybe Bool
-&gt; SyntaxExpr GhcTc
-&gt; ExprStmt GhcTc
forall idL idR body.
XLastStmt idL idR body
-&gt; body -&gt; Maybe Bool -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-var">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; LHsExpr GhcTc
</span><a href="GHC.HsToCore.Utils.html#mkBigLHsVarTupId"><span class="hs-identifier hs-var">mkBigLHsVarTupId</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154925"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681154924"><span class="hs-identifier hs-var">ret_op</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-636"></span><span>
</span><span id="line-637"></span><span>
</span><span id="line-638"></span><span class="hs-comment">-- The `unzip` function for `GroupStmt` in a monad comprehensions</span><span>
</span><span id="line-639"></span><span class="hs-comment">--</span><span>
</span><span id="line-640"></span><span class="hs-comment">--   unzip :: m (a,b,..) -&gt; (m a,m b,..)</span><span>
</span><span id="line-641"></span><span class="hs-comment">--   unzip m_tuple = ( liftM selN1 m_tuple</span><span>
</span><span id="line-642"></span><span class="hs-comment">--                   , liftM selN2 m_tuple</span><span>
</span><span id="line-643"></span><span class="hs-comment">--                   , .. )</span><span>
</span><span id="line-644"></span><span class="hs-comment">--</span><span>
</span><span id="line-645"></span><span class="hs-comment">--   mkMcUnzipM fmap ys [t1, t2]</span><span>
</span><span id="line-646"></span><span class="hs-comment">--     = ( fmap (selN1 :: (t1, t2) -&gt; t1) ys</span><span>
</span><span id="line-647"></span><span class="hs-comment">--       , fmap (selN2 :: (t1, t2) -&gt; t2) ys )</span><span>
</span><span id="line-648"></span><span>
</span><span id="line-649"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#mkMcUnzipM"><span class="hs-identifier hs-type">mkMcUnzipM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#TransForm"><span class="hs-identifier hs-type">TransForm</span></a></span><span>
</span><span id="line-650"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>      </span><span class="hs-comment">-- fmap</span><span>
</span><span id="line-651"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>                </span><span class="hs-comment">-- Of type n (a,b,c)</span><span>
</span><span id="line-652"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>            </span><span class="hs-comment">-- [a,b,c]   (not levity-polymorphic)</span><span>
</span><span id="line-653"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>      </span><span class="hs-comment">-- Of type (n a, n b, n c)</span><span>
</span><span id="line-654"></span><span id="mkMcUnzipM"><span class="annot"><span class="annottext">mkMcUnzipM :: TransForm -&gt; HsExpr GhcTc -&gt; Id -&gt; [Type] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.ListComp.html#mkMcUnzipM"><span class="hs-identifier hs-var hs-var">mkMcUnzipM</span></a></span></span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="GHC.Hs.Expr.html#ThenForm"><span class="hs-identifier hs-var">ThenForm</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681154923"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154923"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-655"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154923"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- No unzipping to do</span><span>
</span><span id="line-656"></span><span>
</span><span id="line-657"></span><span class="annot"><a href="GHC.HsToCore.ListComp.html#mkMcUnzipM"><span class="hs-identifier hs-var">mkMcUnzipM</span></a></span><span> </span><span class="annot"><span class="annottext">TransForm
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681154922"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681154922"><span class="hs-identifier hs-var">fmap_op</span></a></span></span><span> </span><span id="local-6989586621681154921"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154921"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span id="local-6989586621681154920"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681154920"><span class="hs-identifier hs-var">elt_tys</span></a></span></span><span>
</span><span id="line-658"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681154919"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154919"><span class="hs-identifier hs-var">fmap_op'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier hs-var">dsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681154922"><span class="hs-identifier hs-var">fmap_op</span></a></span><span>
</span><span id="line-659"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154918"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154918"><span class="hs-identifier hs-var">xs</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; DsM Id) -&gt; [Type] -&gt; DsM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681154920"><span class="hs-identifier hs-var">elt_tys</span></a></span><span>
</span><span id="line-660"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681154917"><span class="annot"><span class="annottext">tup_ty :: Type
</span><a href="#local-6989586621681154917"><span class="hs-identifier hs-var hs-var">tup_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var">mkBigCoreTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681154920"><span class="hs-identifier hs-var">elt_tys</span></a></span><span>
</span><span id="line-661"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681154916"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154916"><span class="hs-identifier hs-var">tup_xs</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154917"><span class="hs-identifier hs-var">tup_ty</span></a></span><span>
</span><span id="line-662"></span><span>
</span><span id="line-663"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681154915"><span class="annot"><span class="annottext">mk_elt :: Int -&gt; CoreExpr
</span><a href="#local-6989586621681154915"><span class="hs-identifier hs-var hs-var">mk_elt</span></a></span></span><span> </span><span id="local-6989586621681154914"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681154914"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681154919"><span class="hs-identifier hs-var">fmap_op'</span></a></span><span>  </span><span class="hs-comment">-- fmap :: forall a b. (a -&gt; b) -&gt; n a -&gt; n b</span><span>
</span><span id="line-664"></span><span>                           </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681154917"><span class="hs-identifier hs-var">tup_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Int -&gt; Type
forall a. Outputable a =&gt; [a] -&gt; Int -&gt; a
</span><a href="GHC.Data.List.SetOps.html#getNth"><span class="hs-identifier hs-var">getNth</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681154920"><span class="hs-identifier hs-var">elt_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681154914"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-665"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CoreExpr
</span><a href="#local-6989586621681154913"><span class="hs-identifier hs-var">mk_sel</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681154914"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154921"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-666"></span><span>
</span><span id="line-667"></span><span>             </span><span id="local-6989586621681154913"><span class="annot"><span class="annottext">mk_sel :: Int -&gt; CoreExpr
</span><a href="#local-6989586621681154913"><span class="hs-identifier hs-var hs-var">mk_sel</span></a></span></span><span> </span><span id="local-6989586621681154912"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681154912"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154916"><span class="hs-identifier hs-var">tup_xs</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-668"></span><span>                        </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleSelector"><span class="hs-identifier hs-var">mkTupleSelector</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154918"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Int -&gt; Id
forall a. Outputable a =&gt; [a] -&gt; Int -&gt; a
</span><a href="GHC.Data.List.SetOps.html#getNth"><span class="hs-identifier hs-var">getNth</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681154918"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681154912"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154916"><span class="hs-identifier hs-var">tup_xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681154916"><span class="hs-identifier hs-var">tup_xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-669"></span><span>
</span><span id="line-670"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var">mkBigCoreTup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int -&gt; CoreExpr) -&gt; [Int] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; CoreExpr
</span><a href="#local-6989586621681154915"><span class="hs-identifier hs-var">mk_elt</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-glyph">..</span><span class="annot"><span class="annottext">[Type] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681154920"><span class="hs-identifier hs-var">elt_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-671"></span></pre></body></html>